summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/temp_arg_template.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-06 14:15:26 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-06 14:15:26 +0000
commit229c281d377385ea6c00965bb688e7a666441ef9 (patch)
tree04467b7260f4464aac7f1167c90c71539a81d9f3 /clang/test/SemaTemplate/temp_arg_template.cpp
parent72609059187fad96eb8e5ac07df4b978da1d075f (diff)
downloadbcm5719-llvm-229c281d377385ea6c00965bb688e7a666441ef9.tar.gz
bcm5719-llvm-229c281d377385ea6c00965bb688e7a666441ef9.zip
Remove some incorrect assertions when deduction template arguments in
a template-argument-list. When template template parameters are involved, we won't already have checked the template-argument-list (it may not be known yet!). Fixes PR7807. llvm-svn: 110444
Diffstat (limited to 'clang/test/SemaTemplate/temp_arg_template.cpp')
-rw-r--r--clang/test/SemaTemplate/temp_arg_template.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/temp_arg_template.cpp b/clang/test/SemaTemplate/temp_arg_template.cpp
index 667122583fd..944acacd844 100644
--- a/clang/test/SemaTemplate/temp_arg_template.cpp
+++ b/clang/test/SemaTemplate/temp_arg_template.cpp
@@ -33,3 +33,21 @@ A<f> *a9; // expected-error{{must be a class template}}
// FIXME: The code below is ill-formed, because of the evil digraph '<:'.
// We should provide a much better error message than we currently do.
// A<::N::Z> *a10;
+
+// PR7807
+namespace N {
+ template <typename, typename = int>
+ struct X
+ { };
+
+ template <typename ,int>
+ struct Y
+ { X<int> const_ref(); };
+
+ template <template<typename,int> class TT, typename T, int N>
+ int operator<<(int, TT<T, N> a) { // expected-note{{candidate template ignored}}
+ 0 << a.const_ref(); // expected-error{{invalid operands to binary expression ('int' and 'X<int>')}}
+ }
+
+ void f0( Y<int,1> y){ 1 << y; } // expected-note{{in instantiation of function template specialization 'N::operator<<<Y, int, 1>' requested here}}
+}
OpenPOWER on IntegriCloud