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.