From: Richard Smith Date: Wed, 29 Apr 2015 17:48:08 +0000 (+0000) Subject: Revert r236063 due to regression with -fdelayed-template-parsing. X-Git-Tag: llvmorg-3.7.0-rc1~5720 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6282b215ccfd20f9dce63e97fbb08945c2dccb7d;p=platform%2Fupstream%2Fllvm.git Revert r236063 due to regression with -fdelayed-template-parsing. llvm-svn: 236134 --- diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 57faa1c..8f2e95a 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1302,19 +1302,11 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) { // DR1484 clarifies that the members of a local class are instantiated as part // of the instantiation of their enclosing entity. if (D->isCompleteDefinition() && D->isLocalClass()) { - Sema::SavePendingLocalImplicitInstantiationsRAII - SavedPendingLocalImplicitInstantiations(SemaRef); - SemaRef.InstantiateClass(D->getLocation(), Record, D, TemplateArgs, TSK_ImplicitInstantiation, /*Complain=*/true); - SemaRef.InstantiateClassMembers(D->getLocation(), Record, TemplateArgs, TSK_ImplicitInstantiation); - - // This class may have local implicit instantiations that need to be - // performed within this scope. - SemaRef.PerformPendingInstantiations(/*LocalOnly=*/true); } SemaRef.DiagnoseUnusedNestedTypedefs(Record); diff --git a/clang/test/SemaTemplate/instantiate-local-class.cpp b/clang/test/SemaTemplate/instantiate-local-class.cpp index 668fb6f..367134a 100644 --- a/clang/test/SemaTemplate/instantiate-local-class.cpp +++ b/clang/test/SemaTemplate/instantiate-local-class.cpp @@ -213,16 +213,3 @@ namespace PR23194 { return make_seed_pair(); } } - -namespace PR20625 { -template -void f() { - struct N { - static constexpr int get() { return 42; } - }; - constexpr int n = N::get(); - static_assert(n == 42, "n == 42"); -} - -void g() { f(); } -}