diff options
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 | ||||
-rw-r--r-- | test/Sema/decl-invalid.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 72611ef08b..603b8b31a2 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2620,7 +2620,7 @@ Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group, } } return DeclGroupPtrTy::make(DeclGroupRef::Create(Context, - &Decls[0], NumDecls)); + &Decls[0], Decls.size())); } diff --git a/test/Sema/decl-invalid.c b/test/Sema/decl-invalid.c index 0e10bdd8c1..e14bc9891a 100644 --- a/test/Sema/decl-invalid.c +++ b/test/Sema/decl-invalid.c @@ -8,6 +8,10 @@ typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anony void x(); int a() { int r[x()]; // expected-error {{size of array has non-integer type 'void'}} + + static y ?; // expected-error{{unknown type name 'y'}} \ + expected-error{{expected identifier or '('}} \ + expected-error{{expected ';' at end of declaration}} } int; // expected-error {{declaration does not declare anything}} |