FunctionProtoTypeLoc with NULL function parameter types, which can
occur in invalid code. Fixes PR9247 / <rdar://problem/
9037911>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126262
91177308-0d34-0410-b5e6-
96231b3b80d8
void Check(FunctionProtoTypeLoc TL, Sema::AbstractDiagSelID Sel) {
Visit(TL.getResultLoc(), Sema::AbstractReturnType);
for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) {
+ if (!TL.getArg(I))
+ continue;
+
TypeSourceInfo *TSI = TL.getArg(I)->getTypeSourceInfo();
if (TSI) Visit(TSI->getTypeLoc(), Sema::AbstractParamType);
}
static D x; // expected-error {{abstract class}}
};
}
+
+// PR9247: Crash on invalid in clang::Sema::ActOnFinishCXXMemberSpecification
+namespace pr9247 {
+ struct A {
+ virtual void g(const A& input) = 0;
+ struct B {
+ C* f(int foo);
+ };
+ };
+}