Author: dgregor
Date: Fri Aug 21 17:16:40 2009
New Revision: 79678

URL: http://llvm.org/viewvc/llvm-project?rev=79678&view=rev
Log:
Fix parsing for out-of-line definitions of constructors and
destructors of class templates.

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=79678&r1=79677&r2=79678&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Aug 21 17:16:40 2009
@@ -329,7 +329,7 @@
                               const CXXScopeSpec *SS) {
   CXXRecordDecl *CurDecl;
   if (SS && SS->isSet() && !SS->isInvalid()) {
-    DeclContext *DC = computeDeclContext(*SS);
+    DeclContext *DC = computeDeclContext(*SS, true);
     CurDecl = dyn_cast_or_null<CXXRecordDecl>(DC);
   } else
     CurDecl = dyn_cast_or_null<CXXRecordDecl>(CurContext);

Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp?rev=79678&r1=79677&r2=79678&view=diff

==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp 
(original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp Fri Aug 
21 17:16:40 2009
@@ -5,6 +5,9 @@
 public:
   typedef int size_type;
   
+  X0(int);
+  ~X0();
+  
   void f0(const T&, const U&);
   
   T& operator[](int i) const;
@@ -46,4 +49,10 @@
 void X0<T, U>::f0(const T&, const U&) { // expected-error{{redefinition}}
 }
 
-// FIXME: test out-of-line constructors, destructors
+// Test out-of-line constructors, destructors
+template<typename T, typename U>
+X0<T, U>::X0(int x) : value(x) { }
+
+template<typename T, typename U>
+X0<T, U>::~X0() { }
+


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to