You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template< typename C, typename X >
requires std::is_same_v<C, X>
autoas( X const& x ) -> auto&& {
return5;
}
intmain() {
static_assert(std::is_same_v<decltype(as<int>(5)), int&&>);
}
The text was updated successfully, but these errors were encountered:
kelbon
changed the title
All uses auto&& in signatures possibly undefined behavior
All uses auto&& in function signatures potentially undefined behavior
Dec 22, 2022
cppfront/include/cpp2util.h
Line 719 in 2f37277
Its not equal to decltype(auto).
If returns by value, then auto&& generates dangling rvalue reference, while decltype(auto) returns by value as needed
https://godbolt.org/z/7Gfr5fb1d
The text was updated successfully, but these errors were encountered: