Skip to content

Wrong processing of overloaded set within requires-expression #97753

@Fedr

Description

@Fedr

This program

void f();
void f(int);

template<typename T>
concept C = sizeof(T) == 42;

// accepted by Clang, but why?
static_assert( requires {{ &f } -> C;} );

looks ill formed because &f is an address of overloaded function. And the program is rejected by GCC and MSVC, but Clang accepts it. Online demo: https://gcc.godbolt.org/z/99q9M5afY

Metadata

Metadata

Assignees

Labels

c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 concepts

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions