clang incorrectly considers top-level cv-qualifiers when determining the parameter mapping for subsumption (original) (raw)

Clang considers overload resolution for f(42) in this program to be ambiguous:

template concept True = true; template constexpr bool f(const T) { return false;} template constexpr bool f(T) { return true; } static_assert(f(42));

which I believe is (or at least should be - the wording around parameter mappings is a bit sparse) non-conforming. Top-level cv-qualifiers on function parameters in C++ should have no effect outside the body of the function definition. This behavior notably diverges from GCC and MSVC (https://godbolt.org/z/jhvnsf8nf).