diff options
Diffstat (limited to 'test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp')
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp new file mode 100644 index 0000000..2a7f16d --- /dev/null +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template<int i> class A { }; +template<short s> void f(A<s>); // expected-note{{failed template argument deduction}} + +void k1() { + A<1> a; + f(a); // expected-error{{no matching function for call}} + f<1>(a); +} +template<const short cs> class B { }; +template<short s> void g(B<s>); +void k2() { + B<1> b; + g(b); // OK: cv-qualifiers are ignored on template parameter types +} + +template<short s> void h(int (&)[s]); // expected-note{{failed template argument deduction}} +void k3() { + int array[5]; + h(array); + h<5>(array); +} + +template<short s> void h(int (&)[s], A<s>); // expected-note{{failed template argument deduction}} +void k4() { + A<5> a; + int array[5]; + h(array, a); // expected-error{{no matching function for call}} + h<5>(array, a); +} |