aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiation-depth-subst-2.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit56d91b49b13fe55c918afbda19f6165b5fbff87a (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/SemaTemplate/instantiation-depth-subst-2.cpp
parent41e20f564abdb05101d6b2b29c59459a966c22cc (diff)
downloadsrc-56d91b49b13fe55c918afbda19f6165b5fbff87a.tar.gz
src-56d91b49b13fe55c918afbda19f6165b5fbff87a.zip
Vendor import of clang trunk r161861:vendor/clang/clang-trunk-r161861
Notes
Notes: svn path=/vendor/clang/dist/; revision=239313 svn path=/vendor/clang/clang-trunk-r161861/; revision=239314; tag=vendor/clang/clang-trunk-r161861
Diffstat (limited to 'test/SemaTemplate/instantiation-depth-subst-2.cpp')
-rw-r--r--test/SemaTemplate/instantiation-depth-subst-2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiation-depth-subst-2.cpp b/test/SemaTemplate/instantiation-depth-subst-2.cpp
new file mode 100644
index 000000000000..a29d6b5a1b4c
--- /dev/null
+++ b/test/SemaTemplate/instantiation-depth-subst-2.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify %s -ftemplate-depth 2
+
+template<int N> struct S { };
+// FIXME: We produce the same 'instantiation depth' error here many times
+// (2^(depth+1) in total), due to additional lookups performed as part of
+// error recovery in DiagnoseTwoPhaseOperatorLookup.
+template<typename T> S<T() + T()> operator+(T, T); // expected-error 8{{}} expected-note 10{{}}
+S<0> s;
+int k = s + s; // expected-error {{invalid operands to binary expression}}