https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67633

            Bug ID: 67633
           Summary: decltype on parenthesized class member access of a
                    prvalue sometimes return wrong results
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

Per the resolution of CWG 616, given struct A { double x; };, decltype((A().x))
should be double&&.

However, the following snippet (incorrectly) compiles:

struct A { double x; };
using t1 = double;
using t1 = decltype((A().x));

Note that the following snippet (correctly) does not compile:

struct A { double x; };
struct B : A {};
using t1 = double;
using t1 = decltype((B().x));

Reply via email to