diff options
-rw-r--r-- | lib/Analysis/CFG.cpp | 5 | ||||
-rw-r--r-- | test/SemaCXX/return-noreturn.cpp | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index c433639ec1..fc50071a32 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -2782,9 +2782,10 @@ const CXXDestructorDecl *CFGImplicitDtor::getDestructorDecl() const { case CFGElement::AutomaticObjectDtor: { const VarDecl *var = cast<CFGAutomaticObjDtor>(this)->getVarDecl(); QualType ty = var->getType(); + ty = ty.getNonReferenceType(); const RecordType *recordType = ty->getAs<RecordType>(); const CXXRecordDecl *classDecl = - cast<CXXRecordDecl>(recordType->getDecl()); + cast<CXXRecordDecl>(recordType->getDecl()); return classDecl->getDestructor(); } case CFGElement::TemporaryDtor: { @@ -2799,7 +2800,7 @@ const CXXDestructorDecl *CFGImplicitDtor::getDestructorDecl() const { // Not yet supported. return 0; } - assert(0 && "getKind() returned bogus value"); + llvm_unreachable("getKind() returned bogus value"); return 0; } diff --git a/test/SemaCXX/return-noreturn.cpp b/test/SemaCXX/return-noreturn.cpp index 890fb9017c..4fb3732201 100644 --- a/test/SemaCXX/return-noreturn.cpp +++ b/test/SemaCXX/return-noreturn.cpp @@ -27,3 +27,15 @@ int pr6884_h(int x) { } } } + +// PR9380 +struct PR9380 { + ~PR9380(); +}; +struct PR9380_B : public PR9380 { + PR9380_B( const PR9380& str ); +}; +void test_PR9380(const PR9380& aKey) { + const PR9380& flatKey = PR9380_B(aKey); +} + |