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++/68970] New: Missing "expected ; after class" message


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68970

            Bug ID: 68970
           Summary: Missing "expected ; after class" message
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

http://clang.llvm.org/diagnostics.html has this example within "Quality of
Implementation and Attention to Detail"

$ cat t.cc
template<class T>
class a {};
struct b {}
a<int> c;

$ gcc-4.9 t.cc
t.cc:4:8: error: invalid declarator before 'c'
 a<int> c;
         ^

$ clang t.cc
t.cc:3:12: error: expected ';' after struct
struct b {}
          ^
          ;

This still affects trunk for gcc 6, as of r231691.


The related example currently on
https://gcc.gnu.org/wiki/ClangDiagnosticsComparison
*does* work though:

$ cat t2.cc
template<class T>
class a {}
class temp {};
a<temp> b;
struct b {
}

t2.cc:2:10: error: expected â;â after class definition
 class a {}
          ^

t2.cc:6:1: error: expected â;â after struct definition
 }
 ^

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