forked from OSchip/llvm-project
When checking for abstract types, don't crash when we have a
FunctionProtoTypeLoc with NULL function parameter types, which can occur in invalid code. Fixes PR9247 / <rdar://problem/9037911>. llvm-svn: 126262
This commit is contained in:
parent
bb6db56028
commit
385d3fd97d
|
@ -2588,6 +2588,9 @@ struct CheckAbstractUsage {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -249,3 +249,13 @@ namespace test4 {
|
|||
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);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue