summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/typename-specifier-3.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-06-11 01:01:02 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-06-11 01:01:02 +0000
commit3c94374c4b7a3ce800bf2b991518d61b04b67f21 (patch)
tree0e387af7c89e58e69054e42f921446c292b8f3a3 /test/SemaTemplate/typename-specifier-3.cpp
parent2e0cdb4e5442c2f1976dcf8f304bfa6b5f90f728 (diff)
downloadclang-3c94374c4b7a3ce800bf2b991518d61b04b67f21.tar.gz
Move test to be with the other typename tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/typename-specifier-3.cpp')
-rw-r--r--test/SemaTemplate/typename-specifier-3.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/typename-specifier-3.cpp b/test/SemaTemplate/typename-specifier-3.cpp
new file mode 100644
index 0000000000..8dde6095e5
--- /dev/null
+++ b/test/SemaTemplate/typename-specifier-3.cpp
@@ -0,0 +1,19 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// PR4364
+template<class T> struct a {
+ T b() {
+ return typename T::x();
+ }
+};
+struct B {
+ typedef B x;
+};
+B c() {
+ a<B> x;
+ return x.b();
+}
+
+// Some extra tests for invalid cases
+template<class T> struct test2 { T b() { return typename T::a; } }; // expected-error{{expected '(' for function-style cast or type construction}}
+template<class T> struct test3 { T b() { return typename a; } }; // expected-error{{expected a qualified name after 'typename'}}