void f() {
int +; // crash here
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58846
91177308-0d34-0410-b5e6-
96231b3b80d8
void Sema::ActOnUninitializedDecl(DeclTy *dcl) {
Decl *RealDecl = static_cast<Decl *>(dcl);
+ // If there is no declaration, there was an error parsing it. Just ignore it.
+ if (RealDecl == 0)
+ return;
+
if (VarDecl *Var = dyn_cast<VarDecl>(RealDecl)) {
QualType Type = Var->getType();
// C++ [dcl.init.ref]p3:
int test() {
int a[10];
int b[10] = a; // expected-error {{initialization with "{...}" expected}}
+int +; // expected-error {{expected identifier or '('}} expected-error {{declarator requires an identifier}} expected-error {{parse error}}
}