Clang applies constraint checking loosely in variable declaration with concepts #54443
Labels
accepts-invalid
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
concepts
C++20 concepts
The following code compiled with Clang, but not with GCC or MSVC:
Both GCC and MSVC complain that the constraint
same_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
The text was updated successfully, but these errors were encountered: