ActOnDeclarator can return NULL. Fixes PR10270, from Hans Wennborg!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134416
91177308-0d34-0410-b5e6-
96231b3b80d8
"Parser allowed 'typedef' as storage class of condition decl.");
Decl *Dcl = ActOnDeclarator(S, D);
+ if (!Dcl)
+ return true;
+
if (isa<FunctionDecl>(Dcl)) { // The declarator shall not specify a function.
Diag(Dcl->getLocation(), diag::err_invalid_use_of_function_type)
<< D.getSourceRange();
- return DeclResult();
+ return true;
}
return Dcl;
Write(x);
}
}
+
+namespace PR10270 {
+ template<typename T> class C;
+ template<typename T> void f() {
+ if (C<T> == 1) // expected-error{{expected unqualified-id}} \
+ // expected-error{{invalid '==' at end of declaration}}
+ return;
+ }
+}