[Bug c++/67633] decltype on parenthesized class member access of a prvalue sometimes return wrong results
felix.morgner at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 24 18:12:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67633
--- Comment #1 from Felix Morgner <felix.morgner at gmail dot com> ---
The same holds true for GCC 7.1 and the deduced type for decltype(auto):
#include <iostream>
#include <type_traits>
struct s{int v{};};
decltype(auto) f()
{
return (s{}.v);
}
int main()
{
std::cout << std::is_same<int &&, decltype(f())>{} << '\n';
}
prints 0 instead of 1.
More information about the Gcc-bugs
mailing list