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
// expanded NTTP should be a pack expansion type?
return Sema::TDK_Success;
- // Get the type of the parameter for deduction.
- QualType ParamType = NTTP->getType();
+ // Get the type of the parameter for deduction. If it's a (dependent) array
+ // or function type, we will not have decayed it yet, so do that now.
+ QualType ParamType = S.Context.getAdjustedParameterType(NTTP->getType());
if (auto *Expansion = dyn_cast<PackExpansionType>(ParamType))
ParamType = Expansion->getPattern();
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 {