[Bug c++/66672] std::is_same wrong result for captured reference value inside a lambda
anders at knatten dot org
gcc-bugzilla@gcc.gnu.org
Thu Mar 15 10:56:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66672
Anders Schau Knatten <anders at knatten dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anders at knatten dot org
--- Comment #3 from Anders Schau Knatten <anders at knatten dot org> ---
Hi, Anders from cppquiz.org here, in which the example code for this bug report
originated.
The entire §5.1.2¶18 from C++11 seems to be gone from
http://eel.is/c++draft/expr.prim.lambda. It used to say:
"Every occurrence of decltype((x)) where x is a possibly parenthesized
id-expression that names an entity of automatic storage duration is treated as
if x were transformed into an access to a corresponding data member of the
closure type that would have been declared if x were an odr-use of the denoted
entity."
So I believe clang is correct according to c++11, and gcc is correct according
to whichever standard removed that sentence.
A bug was also opened against cppquiz.org for this very question, you can see
the discussion at https://github.com/knatten/cppquiz/issues/96 if you're
interested.
More information about the Gcc-bugs
mailing list