summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/deduction-crash.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaTemplate/deduction-crash.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/SemaTemplate/deduction-crash.cpp')
-rw-r--r--test/SemaTemplate/deduction-crash.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/test/SemaTemplate/deduction-crash.cpp b/test/SemaTemplate/deduction-crash.cpp
index 0714c5e..ff7421a 100644
--- a/test/SemaTemplate/deduction-crash.cpp
+++ b/test/SemaTemplate/deduction-crash.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1| FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only %s -std=c++11 2>&1| FileCheck %s
// Note that the error count below doesn't matter. We just want to
// make sure that the parser doesn't crash.
-// CHECK: 15 errors
+// CHECK: 16 errors
// PR7511
template<a>
@@ -110,3 +110,35 @@ namespace libcxx_test {
template <class T> struct B {};
__pointer_traits_element_type<B<int>, true>::type x;
}
+
+namespace PR14281_part1 {
+ template <class P, int> struct A;
+ template <class P> struct A<P, 1>;
+ template <template <class, int> class S, class T> struct A<S<T, 1>, 1> {
+ typedef char type;
+ };
+ template <class T, int i> struct B {};
+ A<B<int, 1>, 1>::type x;
+}
+
+namespace PR14281_part2 {
+ typedef decltype(nullptr) nullptr_t;
+ template <class P, nullptr_t> struct A;
+ template <class P> struct A<P, nullptr>;
+ template <template <class, nullptr_t> class S, class T> struct A<S<T, nullptr>, nullptr> {
+ typedef char type;
+ };
+ template <class T, nullptr_t i> struct B {};
+ A<B<int, nullptr>, nullptr>::type x;
+}
+
+namespace PR14281_part3 {
+ extern int some_decl;
+ template <class P, int*> struct A;
+ template <class P> struct A<P, &some_decl>;
+ template <template <class, int*> class S, class T> struct A<S<T, &some_decl>, &some_decl> {
+ typedef char type;
+ };
+ template <class T, int* i> struct B {};
+ A<B<int, &some_decl>, &some_decl>::type x;
+}
OpenPOWER on IntegriCloud