aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-07-14 23:41:35 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-07-14 23:41:35 +0000
commit29146add4c9952f79b82b7f3d1f0bf0d4cb0e17e (patch)
tree94b6783a48c7dbaa03fa8110d88526ce14149efb
parent0c106995d52738c4cc0e25edffd6ae2ffaea817d (diff)
Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75712 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/DeclPrinter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index d417fbb7e8..c7ad8d0a71 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -351,11 +351,12 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
FieldDecl *FD = BMInitializer->getMember();
Out << FD->getNameAsString();
}
- else {
- const RecordType *RT =
- BMInitializer->getBaseClass()->getAsRecordType();
- const CXXRecordDecl *BaseDecl = cast<CXXRecordDecl>(RT->getDecl());
- Out << BaseDecl->getNameAsString();
+ else // FIXME. skip dependent types for now.
+ if (const RecordType *RT =
+ BMInitializer->getBaseClass()->getAsRecordType()) {
+ const CXXRecordDecl *BaseDecl =
+ cast<CXXRecordDecl>(RT->getDecl());
+ Out << BaseDecl->getNameAsString();
}
if (hasArguments) {
Out << "(";