summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-09 00:43:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-09 00:43:47 +0000
commitf3bc0e63c5d35ea3872a8ad1589608c8ef635934 (patch)
tree5c5658fcde878ef4de64b2eba22044d8aaee6590 /test/SemaTemplate
parentc900a4b13d5e4746201cb3c8f6229e5cad3b35d9 (diff)
Implement C++ DR1391 (wg21.link/cwg1391)
Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation. This re-commits r290808, reverted in r290811, with a fix for handling of explicitly-specified template argument packs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index 93f11b5657..27a0a03f84 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -173,12 +173,16 @@ namespace pr6249 {
}
namespace PR6723 {
- template<unsigned char C> void f(int (&a)[C]); // expected-note {{candidate template ignored}} \
- // expected-note{{substitution failure [with C = '\x00']}}
+ template<unsigned char C> void f(int (&a)[C]); // expected-note 3{{candidate template ignored: substitution failure [with C = '\x00']}}
+ // expected-note@-1 {{not viable: no known conversion from 'int [512]' to 'int (&)[0]'}}
void g() {
int arr512[512];
f(arr512); // expected-error{{no matching function for call}}
f<512>(arr512); // expected-error{{no matching function for call}}
+
+ int arr0[0];
+ f(arr0); // expected-error{{no matching function for call}}
+ f<0>(arr0); // expected-error{{no matching function for call}}
}
}