summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/missing-class-keyword-crash.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2011-08-25 23:22:24 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2011-08-25 23:22:24 +0000
commit045bde420bc1fda33aee8610bcc4c0f4608cb2d7 (patch)
treed230158f0194fa05d7183d7443b9010eb6ea9115 /clang/test/SemaTemplate/missing-class-keyword-crash.cpp
parent16746d1f97f7ca6fcc6c15cbef5705b8f6ff3418 (diff)
downloadbcm5719-llvm-045bde420bc1fda33aee8610bcc4c0f4608cb2d7.tar.gz
bcm5719-llvm-045bde420bc1fda33aee8610bcc4c0f4608cb2d7.zip
Fix a crash-on-invalid.
Much to everyone's surprise, the default constructor for TypeResult produces an instance with Invalid == false. This seems like a decision we may want to revisit. llvm-svn: 138601
Diffstat (limited to 'clang/test/SemaTemplate/missing-class-keyword-crash.cpp')
-rw-r--r--clang/test/SemaTemplate/missing-class-keyword-crash.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/missing-class-keyword-crash.cpp b/clang/test/SemaTemplate/missing-class-keyword-crash.cpp
new file mode 100644
index 00000000000..f0eee2ba2f8
--- /dev/null
+++ b/clang/test/SemaTemplate/missing-class-keyword-crash.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+class G {};
+template <Foo> // expected-error{{unknown type name 'Foo'}} \
+ // expected-note{{template parameter is declared here}}
+class Bar {};
+
+class Bar<G> blah_test; // expected-error{{template argument for non-type template parameter must be an expression}}
OpenPOWER on IntegriCloud