diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-23 03:33:32 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-23 03:33:32 +0000 |
commit | 7d137e3b98f4503e3a49b1d68fd552647f22fa33 (patch) | |
tree | 58e15e0a2bd8d433611ea1a50df00ac907e5fb9a /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | a754a03550003a0f2b93d57e0854be5939814c33 (diff) | |
download | bcm5719-llvm-7d137e3b98f4503e3a49b1d68fd552647f22fa33.tar.gz bcm5719-llvm-7d137e3b98f4503e3a49b1d68fd552647f22fa33.zip |
Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.
llvm-svn: 153304
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index d0ba4db0b5c..ebc43d443db 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -600,7 +600,7 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) { // not the definitions of scoped member enumerations. // FIXME: There appears to be no wording for what happens for an enum defined // within a block scope, but we treat that like a member of a class template. - if (!Enum->isScoped()) + if (!Enum->isScoped() && D->getDefinition()) InstantiateEnumDefinition(Enum, D); return Enum; @@ -610,6 +610,9 @@ void TemplateDeclInstantiator::InstantiateEnumDefinition( EnumDecl *Enum, EnumDecl *Pattern) { Enum->startDefinition(); + // Update the location to refer to the definition. + Enum->setLocation(Pattern->getLocation()); + SmallVector<Decl*, 4> Enumerators; EnumConstantDecl *LastEnumConst = 0; |