[cfe-commits] r79678 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp
Douglas Gregor
dgregor at apple.com
Fri Aug 21 15:17:02 PDT 2009
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() { }
+
More information about the cfe-commits
mailing list