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++/16189] New: obfuscated error message for missing semicolon after declaration in C++


Diagnostic for missing semicolons after struct/class
declarations regressed in 3.4.x.

The misleading error message is also reported on
the *last* line of the *following* struct/class
declaration, which makes it hard for the user to
hunt for the source line containing the error.

Additionally, the message is inconsistent
between the C and C++ front ends for no apparent
reason.


$ cat >foo.cc
struct Foo { int i; }   // semicolon missing
struct Bar { int i; };

$ g++341 foo.cc
foo.cc:2: error: multiple types in one declaration

$ mv foo.cc foo.c
$ gcc341 foo.c
foo.c:2: error: two types specified in one empty declaration

$ g++333 foo.cc
foo.cc:2: error: semicolon missing after declaration of `Foo'
foo.cc:2: error: multiple types in one declaration

-- 
           Summary: obfuscated error message for missing semicolon after
                    declaration in C++
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bernie at develer dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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