]> granicus.if.org Git - clang/commit
Implement PR6180, substantially improving the diagnostics we get from
authorChris Lattner <sabre@nondot.org>
Tue, 2 Feb 2010 01:23:29 +0000 (01:23 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 2 Feb 2010 01:23:29 +0000 (01:23 +0000)
commit4ed5d91db256f7dbe6bf716da0b801004c197254
treefb52567278671cb373c0788a76611c4c00ca0e26
parentae50d501f463d7032320ec31840f60ae68df3a55
Implement PR6180, substantially improving the diagnostics we get from
forgetting a ';' at the end of a struct.  For something like:

class c {
}
void foo() {}

we now produce:

t.cc:3:2: error: expected ';' after class
}
 ^
 ;

instead of:

t.cc:4:1: error: cannot combine with previous 'class' declaration specifier
void foo() {}
^
t.cc:2:7: error: 'class c' can not be defined in the result type of a function
class c {
      ^

GCC produces:

t.cc:4: error: new types may not be defined in a return type
t.cc:4: note: (perhaps a semicolon is missing after the definition of ‘c’)
t.cc:4: error: two or more data types in declaration of ‘foo’

I *think* I got the follow set right, but if I forgot anything, we'll start
getting spurious "expected ';' after class" errors, let me know if you see
any.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95042 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticParseKinds.td
lib/Parse/ParseDeclCXX.cpp
test/Sema/declspec.c