diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-05-24 17:22:01 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-05-24 17:22:01 +0000 |
| commit | 5a5073e4d69a523d25e12526167400a08d8cafb5 (patch) | |
| tree | 7a2dcb59baf24b6f44d07d6b3cff24b53ea8c633 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
| parent | 8d042c02690f102ccc64eacb50db198859157429 (diff) | |
| download | bcm5719-llvm-5a5073e4d69a523d25e12526167400a08d8cafb5.tar.gz bcm5719-llvm-5a5073e4d69a523d25e12526167400a08d8cafb5.zip | |
Make sure that we instantiate variably modified types, even if they
aren't dependent. Fixes <rdar://problem/8020206>.
llvm-svn: 104511
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 10d2bb119d3..834b86da9a0 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/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) { |

