[cfe-commits] r155185 - in /cfe/trunk: lib/Sema/SemaTemplate.cpp test/SemaTemplate/class-template-decl.cpp

Richard Smith richard-llvm at metafoo.co.uk
Thu Apr 19 22:42:37 PDT 2012


Author: rsmith
Date: Fri Apr 20 00:42:36 2012
New Revision: 155185

URL: http://llvm.org/viewvc/llvm-project?rev=155185&view=rev
Log:
Fix a bug which creduce found reducing PR12585.

Modified:
    cfe/trunk/lib/Sema/SemaTemplate.cpp
    cfe/trunk/test/SemaTemplate/class-template-decl.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=155185&r1=155184&r2=155185&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Fri Apr 20 00:42:36 2012
@@ -938,7 +938,7 @@
       while (!OutermostContext->isFileContext())
         OutermostContext = OutermostContext->getLookupParent();
 
-      if (PrevDecl &&
+      if (PrevClassTemplate &&
           (OutermostContext->Equals(PrevDecl->getDeclContext()) ||
            OutermostContext->Encloses(PrevDecl->getDeclContext()))) {
         SemanticContext = PrevDecl->getDeclContext();

Modified: cfe/trunk/test/SemaTemplate/class-template-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/class-template-decl.cpp?rev=155185&r1=155184&r2=155185&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/class-template-decl.cpp (original)
+++ cfe/trunk/test/SemaTemplate/class-template-decl.cpp Fri Apr 20 00:42:36 2012
@@ -95,3 +95,12 @@
   };
 }
 
+namespace Redecl {
+  struct S {
+    int packaged_task;
+    template<typename> class future {
+      template<typename> friend class packaged_task;
+    };
+    future<void> share;
+  };
+}





More information about the cfe-commits mailing list