aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/nested-template.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-25 17:23:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-25 17:23:04 +0000
commit05396e20d68535612f58c84e0dfc7647c75a7da1 (patch)
tree6ebd628caace99d4ec89d58cc21cbcf6c30221e6 /test/SemaTemplate/nested-template.cpp
parentc87efbd2cbd13e68ea771275f03d1bbd1b741e47 (diff)
Implement out-of-line definitions of nested class templates. Most of
the logic is there for out-of-line definitions with multiple levels of nested templates, but this is still a work-in-progress: we're having trouble determining when we should look into a dependent nested-name-specifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/nested-template.cpp')
-rw-r--r--test/SemaTemplate/nested-template.cpp53
1 files changed, 46 insertions, 7 deletions
diff --git a/test/SemaTemplate/nested-template.cpp b/test/SemaTemplate/nested-template.cpp
index 9562bcb51e..05ab3e9c1b 100644
--- a/test/SemaTemplate/nested-template.cpp
+++ b/test/SemaTemplate/nested-template.cpp
@@ -15,16 +15,55 @@ int i;
S::A<int>::Nested::type *ip = &i;
template<typename T>
-struct X0 {
- template<typename U> void f0(T, U);
+struct Outer {
+ template<typename U>
+ class Inner0;
template<typename U>
- struct Inner0 {
- void f1(T, U);
+ class Inner1 {
+ struct ReallyInner;
+
+ T foo(U);
+ template<typename V> T bar(V);
};
};
-template<typename X> template<typename Y> void X0<X>::f0(X, Y) { }
+template<typename X>
+template<typename Y>
+class Outer<X>::Inner0 {
+public:
+ void f(X, Y);
+};
+
+#if 0
+// FIXME: These don't parse properly because we can't handle the template-name
+// "Inner0" or "Inner1" after the dependent type Outer<X>.
+template<typename X>
+template<typename Y>
+void Outer<X>::Inner0<Y>::f(X, Y) {
+}
+
+template<typename X>
+template<typename Y>
+struct Outer<X>::Inner1<Y>::ReallyInner {
+ void g(X, Y);
+};
+
+template<typename X>
+template<typename Y>
+void Outer<X>::Inner1<Y>::ReallyInner::g(X, Y) {
+}
+
+template<typename X>
+template<typename Y>
+X Outer<X>::Inner1<Y>::foo(Y) {
+ return X();
+}
-// FIXME:
-// template<typename X> template<typename Y> void X0<X>::Inner0<Y>::f1(X, Y) { }
+template<typename X>
+template<typename Y>
+template<typename Z>
+X Outer<X>::Inner1<Y>::bar(Z) {
+ return X();
+}
+#endif \ No newline at end of file