-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Closed
Copy link
Labels
accepts-invalidclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 concepts
Description
The following code compiled with Clang, but not with GCC or MSVC:
template <class T, class U>
struct is_same { static constexpr bool value = false; };
template <class T>
struct is_same<T, T> { static constexpr bool value = true; };
template <class T, class U>
concept same_as = is_same<T, U>::value;
int const& f();
same_as<int const&> auto& i = f();Both GCC and MSVC complain that the constraint same_as<int const&> is not satisfied, but Clang accepts it. If we change to same_as<int const> auto& i = f();, then GCC and MSVC accept it, and Clang accepts it too, which is really weird!
Godbolt: https://godbolt.org/z/q5K9885vb
Metadata
Metadata
Assignees
Labels
accepts-invalidclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 concepts
Type
Projects
Status
No status