]> granicus.if.org Git - clang/commitdiff
Fix parsing for out-of-line definitions of constructors and
authorDouglas Gregor <dgregor@apple.com>
Fri, 21 Aug 2009 22:16:40 +0000 (22:16 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 21 Aug 2009 22:16:40 +0000 (22:16 +0000)
destructors of class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79678 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp
test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp

index 5de302e1741fcdd75f97d5fd9f7d20fa0504a5e7..49ad45ad7aea626d8e225b2a84a8d9a4bba3a527 100644 (file)
@@ -329,7 +329,7 @@ bool Sema::isCurrentClassName(const IdentifierInfo &II, Scope *,
                               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);
index c1da8a1f4804d5a5f7992fedbb7c996dcccadc0d..84454900bb5e9885c4f7796388aeff0267cd1f74 100644 (file)
@@ -5,6 +5,9 @@ class X0 {
 public:
   typedef int size_type;
   
+  X0(int);
+  ~X0();
+  
   void f0(const T&, const U&);
   
   T& operator[](int i) const;
@@ -46,4 +49,10 @@ template<typename T, typename U>
 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() { }
+