aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-24 17:22:01 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-24 17:22:01 +0000
commit836adf6771d5170d936599dfcce21687e37e9bbf (patch)
treef4e55e181309cece8d807605f492d96b601f4c91 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parent94a615718d06704816c6e31a811f823c05e39f52 (diff)
Make sure that we instantiate variably modified types, even if they
aren't dependent. Fixes <rdar://problem/8020206>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 10d2bb119d..834b86da9a 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -184,7 +184,8 @@ TemplateDeclInstantiator::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {
Decl *TemplateDeclInstantiator::VisitTypedefDecl(TypedefDecl *D) {
bool Invalid = false;
TypeSourceInfo *DI = D->getTypeSourceInfo();
- if (DI->getType()->isDependentType()) {
+ if (DI->getType()->isDependentType() ||
+ DI->getType()->isVariablyModifiedType()) {
DI = SemaRef.SubstType(DI, TemplateArgs,
D->getLocation(), D->getDeclName());
if (!DI) {
@@ -438,7 +439,8 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) {
bool Invalid = false;
TypeSourceInfo *DI = D->getTypeSourceInfo();
- if (DI->getType()->isDependentType()) {
+ if (DI->getType()->isDependentType() ||
+ DI->getType()->isVariablyModifiedType()) {
DI = SemaRef.SubstType(DI, TemplateArgs,
D->getLocation(), D->getDeclName());
if (!DI) {