This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -fsyntax-only broken?
On Wed, Jan 17, 2001 at 06:57:15PM +0200, Stelios Xanthakis wrote:
>
> Seems to be for C++ at least.
>
> Sample code is:
>
> class A {}; void main () { throw A (); }
>
> But there are various other cases. It appears generally broken.
The current development compiler works fine:
45% cat syn.cc
class A {}; void main () { throw A (); }
46% g++ syn.cc
syn.cc:1: `main' must return `int'
47% g++ -fsyntax-only syn.cc
syn.cc:1: `main' must return `int'
Changing the void to int produces a correct C++ program:
48% sed s/void/int/ syn.cc > synint.cc
49% g++ -fsyntax-only synint.cc
50% g++ synint.cc
51% ./a.out
Aborted (core dumped)
52%
And the uncaught exception, of course, eventually calls abort().
Phil
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.