assert(Tok.is(tok::l_brace));
SourceLocation LBraceLoc = Tok.getLocation();
- if (SkipFunctionBodies && Actions.canSkipFunctionBody(Decl) &&
+ if (SkipFunctionBodies && (!Decl || Actions.canSkipFunctionBody(Decl)) &&
trySkippingFunctionBody()) {
BodyScope.Exit();
return Actions.ActOnSkippedFunctionBody(Decl);
}
Decl *Sema::ActOnSkippedFunctionBody(Decl *Decl) {
- if (FunctionDecl *FD = dyn_cast<FunctionDecl>(Decl))
+ if (FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(Decl))
FD->setHasSkippedBody();
- else if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(Decl))
+ else if (ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(Decl))
MD->setHasSkippedBody();
return ActOnFinishFunctionBody(Decl, 0);
}
using MyTypeAlias = int;
+extern "C" {
+ template < typename T > *Allocate() { }
+}
+
// RUN: c-index-test -index-file %s > %t
// RUN: FileCheck %s -input-file=%t