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

--- Comment #8 from Jens Maurer <jens.maurer at gmx dot net> ---
In general, "x" and "(x)" have the same meaning as per 5.1.1p6.

There are a few (spelled-out) exceptions, though.

One exception is inside a decltype-specifier, where decltype(e) is different
from decltype((e)) as per 7.1.6.2p4.

(Another exception is the fact that  (f)(y)  suppresses argument-dependent
lookup for "f" as per 3.4.2p1.  And then, if "f" is a function-like macro, it
doesn't get expanded for (f)(y).)


Considering the issue in this ticket, and ignoring the fact that "reg" should
be a block-scope variable, "reg" is the name of a variable and therefore an
lvalue.  However, being an lvalue doesn't mean its address is "taken". 
"reg->i" is equivalent to "(reg)->i"; in both cases, the lvalue-to-rvalue
conversion is applied to "reg" to determine its pointer value (see 5.3.1p1).

In short, using "decltype" to inspect the type of an expression might be
misleading if you don't consider the special case in 7.1.6.2p4.

May I venture a guess that the gcc implementation somehow lets the decltype
special case bleed into general expression analysis?

Reply via email to