[Bug c++/16988] New: confusing diagnostic for ill-formed object definition

sebor at roguewave dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 11 19:28:00 GMT 2004


The error message for the program below is misleading. The error
is not /before/ the const qualifier but /after/ it. The diagnostic
for the same program that does not qualify foo with :: is a lot
better: `foo' does not name a type

$ cat t.cpp && gcc -dumpversion && gcc -c t.cpp
int main ()
{
    const ::foo bar = 0;
}

3.4.0
t.cpp: In function `int main()':
t.cpp:3: error: expected primary-expression before "const"
t.cpp:3: error: expected `;' before "const"

-- 
           Summary: confusing diagnostic for ill-formed object definition
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


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



More information about the Gcc-bugs mailing list