summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/JumpDiagnostics.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-01 00:21:21 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-01 00:21:21 +0000
commit5a5fcd83c53ed7708d9a813363a868eba6628865 (patch)
tree0fc7fbde66077c9379623a56cd9efc37afc77d26 /clang/lib/Sema/JumpDiagnostics.cpp
parent8c3f9187f954b32ae0e737b7c05d9af3e71434d0 (diff)
downloadbcm5719-llvm-5a5fcd83c53ed7708d9a813363a868eba6628865.tar.gz
bcm5719-llvm-5a5fcd83c53ed7708d9a813363a868eba6628865.zip
Be a bit more careful with undefined CXXRecordDecls. Fixes
rdar://problem/8124080 and PR7118. llvm-svn: 107358
Diffstat (limited to 'clang/lib/Sema/JumpDiagnostics.cpp')
-rw-r--r--clang/lib/Sema/JumpDiagnostics.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Sema/JumpDiagnostics.cpp b/clang/lib/Sema/JumpDiagnostics.cpp
index 47dfbfbdc8a..3431ac61188 100644
--- a/clang/lib/Sema/JumpDiagnostics.cpp
+++ b/clang/lib/Sema/JumpDiagnostics.cpp
@@ -131,11 +131,13 @@ static std::pair<unsigned,unsigned>
InDiag = diag::note_protected_by_variable_init;
CanQualType T = VD->getType()->getCanonicalTypeUnqualified();
- while (CanQual<ArrayType> AT = T->getAs<ArrayType>())
- T = AT->getElementType();
- if (CanQual<RecordType> RT = T->getAs<RecordType>())
- if (!cast<CXXRecordDecl>(RT->getDecl())->hasTrivialDestructor())
- OutDiag = diag::note_exits_dtor;
+ if (!T->isDependentType()) {
+ while (CanQual<ArrayType> AT = T->getAs<ArrayType>())
+ T = AT->getElementType();
+ if (CanQual<RecordType> RT = T->getAs<RecordType>())
+ if (!cast<CXXRecordDecl>(RT->getDecl())->hasTrivialDestructor())
+ OutDiag = diag::note_exits_dtor;
+ }
}
return std::make_pair(InDiag, OutDiag);
OpenPOWER on IntegriCloud