This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11107] Crash on template member call / static data member inititalization


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11107


bangerth@dealii.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


------- Additional Comments From bangerth@dealii.org  2003-06-06 02:13 -------
This is a known bug, with several duplicates (for example 8206).
It is "fixed" in 3.3 and 3.4, i.e. the ICE doesn't happen any 
more, but the error message is not overly helpful:

g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
x.cc:27: error: ISO C++ forbids defining types within return type
x.cc:27: error: `void (Factory<Method>::)(TCreator<Method>*)' is not an
   aggregate type
x.cc:27: error: syntax error before `::' token


g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:27: error: expected init-declarator
x.cc:27: error: expected `,' or `;'

This not-so-helpful error message is treated elsewhere. The reason for
this weird message stems from the fact that C++ allows this abomination:
    class Method {} foo ();
    Method foo ()  { return Method(); }

So gcc thinks in your code that the big structure denotes the return
type of a function -- which turns out to be a constructor, which can
now have a return type. That's how gcc3.3's message needs to be read.
Now, present mainline is not so easy to interpret...

W.

*** This bug has been marked as a duplicate of 8206 ***



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]