aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/DeclCXX.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 34d746433e..f0c4a089ee 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -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);
}