On Fri, Nov 01, 2019 at 04:42:45PM -0400, Jason Merrill wrote: > It isn't accepted for me: > > wa3.C: In function 'void foo()': > wa3.C:4:29: warning: attribute ignored [-Wattributes] > 4 | auto a = [] () [[noreturn]] constexpr {}; > | ^ > wa3.C:4:29: note: an attribute that appertains to a type-specifier is > ignored > wa3.C: In lambda function: > wa3.C:4:31: error: expected '{' before 'constexpr' > 4 | auto a = [] () [[noreturn]] constexpr {}; > | ^~~~~~~~~ > wa3.C: In function 'void foo()': > wa3.C:4:31: error: expected ',' or ';' before 'constexpr' > wa3.C: In lambda function: > wa3.C:5:44: error: expected '{' before 'constexpr' > 5 | auto b = [] () __attribute__((noreturn)) constexpr {}; > | ^~~~~~~~~ > wa3.C: In function 'void foo()': > wa3.C:5:44: error: expected ',' or ';' before 'constexpr' > > Moving constexpr before the attributes makes it compile.
Ah, used 8.x to test it. There have been r265787 and r269775 changes in between. Though auto d = [] () mutable __attribute__((noreturn)) constexpr {}; auto e = [] () mutable [[noreturn]] constexpr {}; is still accepted. I bet incorrectly though, I can try to fix it in a follow-up patch, but can remove the attribute skipping from the consteval patch then. > > The code should handle mutable consteval, as mutable is a keyword and it > > will just keep looking after that keyword. > > Ah, right. Jakub