[Bug c++/60955] Erroneous warning about taking address of register with std=c++1y
harald at gigawatt dot nl
gcc-bugzilla@gcc.gnu.org
Sat Apr 26 15:45:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60955
Harald van Dijk <harald at gigawatt dot nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |harald at gigawatt dot nl
--- Comment #2 from Harald van Dijk <harald at gigawatt dot nl> ---
This is caused by the implementation of C++1y decltype(auto), where seemingly
redundant parentheses around an identifier must not simply be removed, because
they may be significant.
int a;
decltype(auto) b = a; // means int b = a;
decltype(auto) c = (a); // means int &c = a;
GCC implements this by transforming (a) into static_cast<int &>(a)
(force_paren_expr in gcc/cp/semantics.c), which would normally be a no-op, but
causes the warning when a is declared using the "register" keyword.
More information about the Gcc-bugs
mailing list