[libc++][ranges] ranges::to
can have non-class return type
#132133
Labels
accepts-invalid
libc++
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
ranges
Issues related to `<ranges>`
Currently, this ill-formed program which violates [range.utility.conv.to]/1 and [range.utility.conv.adaptors]/1 isn't rejected when using libc++ (Godbolt link):
It's weird that the "class" part is mentioned in comments but not actually implemented.
llvm-project/libcxx/include/__ranges/to.h
Lines 80 to 83 in ead2724
llvm-project/libcxx/include/__ranges/to.h
Lines 207 to 210 in ead2724
Note that libstdc++ and MSVC STL also reject union types by only using
is_class_v
, despite that the term "class type" in the C++ core language specification also covers union types. Perhaps we should also only accept non-union class types here and submit an LWG issue for this.Edit: LWG4229
The text was updated successfully, but these errors were encountered: