]> granicus.if.org Git - clang/commitdiff
Fix assert.
authorAnders Carlsson <andersca@mac.com>
Fri, 24 Apr 2009 06:06:07 +0000 (06:06 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 24 Apr 2009 06:06:07 +0000 (06:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69961 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclCXX.cpp

index 34d746433e125b4554df1e3a9a7df5356445e91b..f0c4a089ee5875b58542052ed40497fcb8b8fe38 100644 (file)
@@ -377,8 +377,10 @@ StaticAssertDecl::~StaticAssertDecl() {
 
 CXXTempVarDecl *CXXTempVarDecl::Create(ASTContext &C, DeclContext *DC,
                                        QualType T) {
-  assert(isa<CXXRecordDecl>(T->getAsRecordType()->getDecl()) &&
-         "CXXTempVarDecl must have a C++ record type!");
+  assert(T->isDependentType() || 
+         isa<CXXRecordDecl>(T->getAsRecordType()->getDecl()) &&
+         "CXXTempVarDecl must either have a dependent type "
+         "or a C++ record type!");
   return new (C) CXXTempVarDecl(DC, T);
 }