- Notifications
You must be signed in to change notification settings - Fork14.5k
Closed
Description
The following code compiled with Clang, but not with GCC or MSVC:
template<classT,classU>structis_same {staticconstexprbool value =false; };template<classT>structis_same<T, T> {staticconstexprbool value =true; };template<classT,classU>conceptsame_as = is_same<T, U>::value;intconst&f();same_as<intconst&>auto& i = f();
Both GCC and MSVC complain that the constraintsame_as<int const&>
is not satisfied, but Clang accepts it. If we change tosame_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
Type
Projects
Status
No status