summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-11-27 08:20:38 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-11-27 08:20:38 +0000
commit8b5933a189b15f42798030bbdc1a82af434c6beb (patch)
treecba8ce7fd3233d00acc1f68ebe521eaa495c66ed /lib/Sema/SemaTemplate.cpp
parent070d649eefeeb17cce3afaeebe9f825024284854 (diff)
Sema: Instantiate local class and their members appropriately
We would fail to instantiate them when the surrounding function was instantiated. Instantiate the class and add it's members to the list of pending instantiations, they should be resolved when we are finished with the function's body. This fixes PR9685. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 63d8d8db26..e995ae1c36 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -6265,7 +6265,10 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc,
switch (NewTSK) {
case TSK_Undeclared:
case TSK_ImplicitInstantiation:
- llvm_unreachable("Don't check implicit instantiations here");
+ assert(
+ (PrevTSK == TSK_Undeclared || PrevTSK == TSK_ImplicitInstantiation) &&
+ "previous declaration must be implicit!");
+ return false;
case TSK_ExplicitSpecialization:
switch (PrevTSK) {