This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67633] decltype on parenthesized class member access of a prvalue sometimes return wrong results


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]