diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2010-09-27 21:02:09 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2010-09-27 21:02:09 +0000 |
| commit | d75488d0102f9808c427ea7a1c5f8d3ac4010073 (patch) | |
| tree | d652f31850964fe72b5afce554d4dedd65686616 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
| parent | ca54e280d5edb7ccb2b8d80299f43574073ac6a1 (diff) | |
| download | bcm5719-llvm-d75488d0102f9808c427ea7a1c5f8d3ac4010073.tar.gz bcm5719-llvm-d75488d0102f9808c427ea7a1c5f8d3ac4010073.zip | |
Correctly set "explicit template instantiation" kind on inner structs of templates whose explicit instantiation is first declared and then defined.
Fixes http://llvm.org/pr8207
llvm-svn: 114874
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index e4a8ef59b43..5520f640447 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -1447,7 +1447,7 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, if (CheckSpecializationInstantiationRedecl(PointOfInstantiation, TSK, Function, MSInfo->getTemplateSpecializationKind(), - MSInfo->getPointOfInstantiation(), + MSInfo->getPointOfInstantiation(), SuppressNew) || SuppressNew) continue; @@ -1483,7 +1483,7 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, if (CheckSpecializationInstantiationRedecl(PointOfInstantiation, TSK, Var, MSInfo->getTemplateSpecializationKind(), - MSInfo->getPointOfInstantiation(), + MSInfo->getPointOfInstantiation(), SuppressNew) || SuppressNew) continue; @@ -1518,11 +1518,11 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, if (MSInfo->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) continue; - + if (CheckSpecializationInstantiationRedecl(PointOfInstantiation, TSK, Record, MSInfo->getTemplateSpecializationKind(), - MSInfo->getPointOfInstantiation(), + MSInfo->getPointOfInstantiation(), SuppressNew) || SuppressNew) continue; @@ -1549,6 +1549,13 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, InstantiateClass(PointOfInstantiation, Record, Pattern, TemplateArgs, TSK); + } else { + if (TSK == TSK_ExplicitInstantiationDefinition && + Record->getTemplateSpecializationKind() == + TSK_ExplicitInstantiationDeclaration) { + Record->setTemplateSpecializationKind(TSK); + MarkVTableUsed(PointOfInstantiation, Record, true); + } } Pattern = cast_or_null<CXXRecordDecl>(Record->getDefinition()); |

