This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67633] decltype on parenthesized class member access of a prvalue sometimes return wrong results
- From: "felix.morgner at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jul 2017 18:11:55 +0000
- Subject: [Bug c++/67633] decltype on parenthesized class member access of a prvalue sometimes return wrong results
- Auto-submitted: auto-generated
- References: <bug-67633-4@http.gcc.gnu.org/bugzilla/>
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.