diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-01 21:24:36 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-01 21:24:36 +0000 |
commit | 5a9220e6798f1052bbdb4cfa96711fa5ce2f00e9 (patch) | |
tree | 0d2ad8e39a01339a06a426a3a549141fc2c092b4 /test/SemaTemplate | |
parent | e57d4893badb16c9432e5b6788067403319eed08 (diff) |
[c++17] When deducing the type of a non-type template parameter from the type
of its argument, perform function-to-pointer and array-to-pointer decay on the
parameter type first.
Otherwise deduction will fail, as the type of the argument will be decayed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/temp_arg_nontype_cxx1z.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp b/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp index d0fb25c047..1a84d545c6 100644 --- a/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp +++ b/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp @@ -238,6 +238,10 @@ namespace Auto { constexpr char s[] = "test"; template<const auto* p> struct S { }; S<s> p; + + template<typename R, typename P, R F(P)> struct A {}; + template<typename R, typename P, R F(P)> void x(A<R, P, F> a); + void g(int) { x(A<void, int, &g>()); } } namespace DecltypeAuto { |