Skip to content

[clang] Consideration of constraints for address of overloaded function (CWG2918) is not implemented #122523

Closed
@03F001

Description

@03F001

clang 19.1

#include <concepts>

template <typename T>
void f(T) {}

template <typename T>
requires std::same_as<T, int>
void f(T) {}

int main() {
	auto a = f<int>; // error: variable 'a' with type 'auto' has incompatible initializer of type '<overloaded function type>'
}

I don't know whether this should compile, but gcc does accept it. At least the diagnostic could use some work.

https://godbolt.org/z/bojPze9Kf

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partydefect reportIssues representing WG21 papers to be applied as a defect report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions