summaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/template-decl-fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaTemplate/template-decl-fail.cpp')
-rw-r--r--clang/test/SemaTemplate/template-decl-fail.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/template-decl-fail.cpp b/clang/test/SemaTemplate/template-decl-fail.cpp
new file mode 100644
index 0000000..ad134cd
--- /dev/null
+++ b/clang/test/SemaTemplate/template-decl-fail.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template<typename T> typedef T X; // expected-error{{typedef cannot be a template}}
+
+template<typename T>
+enum t0 { A = T::x }; // expected-error{{enumeration cannot be a template}} \
+ // expected-warning{{declaration does not declare anything}}
+
+enum e0 {};
+template<int x> enum e0 f0(int a=x) {}