summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/class-template-id-2.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-25 23:52:28 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-25 23:52:28 +0000
commitd54dfb871882852c00e525bceef0b92fe945d40a (patch)
treeec62f11d206d20332fa810da63ed41e63d3b6b57 /clang/test/SemaTemplate/class-template-id-2.cpp
parentb750d928cecf9b3c4144ac40c6c87da91a34f444 (diff)
downloadbcm5719-llvm-d54dfb871882852c00e525bceef0b92fe945d40a.tar.gz
bcm5719-llvm-d54dfb871882852c00e525bceef0b92fe945d40a.zip
Implementing parsing of template-ids as class-names, so that we can
derive from a class template specialization, e.g., class B : public A<int> { }; llvm-svn: 65488
Diffstat (limited to 'clang/test/SemaTemplate/class-template-id-2.cpp')
-rw-r--r--clang/test/SemaTemplate/class-template-id-2.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/class-template-id-2.cpp b/clang/test/SemaTemplate/class-template-id-2.cpp
new file mode 100644
index 00000000000..dee4735de9e
--- /dev/null
+++ b/clang/test/SemaTemplate/class-template-id-2.cpp
@@ -0,0 +1,23 @@
+// RUN: clang -fsyntax-only -verify %s
+namespace N {
+ template<typename T> class A;
+
+ template<> class A<int> { };
+
+ class B : public A<int> { };
+}
+
+class C1 : public N::A<int> { };
+
+class C2 : public N::A<float> { }; // expected-error{{base class has incomplete type}} \
+ // FIXME: expected-note{{forward declaration of 'class A'}}
+
+struct D1 {
+ operator N::A<int>();
+};
+
+namespace N {
+ struct D2 {
+ operator A<int>();
+ };
+}
OpenPOWER on IntegriCloud