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++/12288] unintelligible error message for constructor declaration with misspelled type


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

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2003-09-15 18:18:23
               date|                            |
            Summary|"expected function-         |unintelligible error message
                   |definition" error compiling |for constructor declaration
                   |constructor                 |with misspelled type


------- Additional Comments From bangerth at dealii dot org  2003-09-15 18:18 -------
If this code compiles with Comeau, then only because their standard
library is non-conforming: there is no type data_type in multimap. Thus,
the whole thing boils down to a snippet like this:
----------------------
class X {};

struct S {
    explicit S (const X::T&) {}
};
----------------------
for which we get this error message:
g/x> /home/bangerth/bin/gcc-3.4*/bin/c++ -c y.cc
y.cc:4: error: ISO C++ forbids declaration of `S' with no type
y.cc:4: error: only declarations of constructors can be `explicit'
y.cc:4: error: expected function-definition

That's totally unintelligible if one doesn't already know the cause
of the problem. Previous versions of gcc gave

g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ -c y.cc
y.cc:4: error: parse error before `&' token
y.cc:4: error: missing ';' before right brace

which is not better either.
W.


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