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++/16988] New: confusing diagnostic for ill-formed object definition


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


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