Skip to content

clang incorrectly considers top-level cv-qualifiers when determining the parameter mapping for subsumption #75404

Open
@CaseyCarter

Description

@CaseyCarter

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

template <class> concept True = true;
template <class T> constexpr bool f(const T) { return false;} 
template <True T> 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorc++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 concepts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions