r236134 - Revert r236063 due to regression with -fdelayed-template-parsing.

Richard Smith richard-llvm at metafoo.co.uk
Wed Apr 29 10:48:08 PDT 2015


Author: rsmith
Date: Wed Apr 29 12:48:08 2015
New Revision: 236134

URL: http://llvm.org/viewvc/llvm-project?rev=236134&view=rev
Log:
Revert r236063 due to regression with -fdelayed-template-parsing.

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
    cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=236134&r1=236133&r2=236134&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Wed Apr 29 12:48:08 2015
@@ -1302,19 +1302,11 @@ Decl *TemplateDeclInstantiator::VisitCXX
   // 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);

Modified: cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp?rev=236134&r1=236133&r2=236134&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp Wed Apr 29 12:48:08 2015
@@ -213,16 +213,3 @@ namespace PR23194 {
     return make_seed_pair();
   }
 }
-
-namespace PR20625 {
-template <typename T>
-void f() {
-  struct N {
-    static constexpr int get() { return 42; }
-  };
-  constexpr int n = N::get();
-  static_assert(n == 42, "n == 42");
-}
-
-void g() { f<void>(); }
-}





More information about the cfe-commits mailing list