<div dir="ltr"><div>@@ -1083,7 +1086,12 @@</div><div>       << FixItHint::CreateInsertion(Tok.getLocation(), "() ");</div><div>     SourceLocation DeclLoc = Tok.getLocation();</div><div>     SourceLocation DeclEndLoc = DeclLoc;</div>
<div>-    </div><div>+</div><div>+    // GNU-style attributes must be parsed before the mutable specifier to be</div><div>+    // compatible with GCC.</div><div>+    ParsedAttributes Attr(AttrFactory);</div><div>+    MaybeParseGNUAttributes(Attr, &DeclEndLoc);</div>
<div><br></div><div><br></div><div>We can't have GNU attributes here: we're inside an "if (Tok.is(tok::kw_mutable) || Tok.is(tok::arrow))" and we've not parsed any tokens yet. GCC doesn't accept </div>
<div><br></div><div>  [] __attribute__(( )) {}</div><div><br></div><div>... so I don't think we need to deal with __attribute__ with missing preceding parens (but it might be nice to do so anyway, if you want!).</div>
<div><br></div><div>Patch looks good with that change reverted.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 4:19 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">GCC allows GNU-style attributes to be applied to a lambda expression,<br>
and such attributes can appertain to the underlying declarations<br>
instead of the types. For instance:<br>
<br>
void f2() {<br>
  [](const char *, ...) __attribute__((sentinel)) { }("%s", 1);<br>
}<br>
<br>
In GCC, these attributes must appear before the mutable or exception<br>
specifier for the lambda (instead of after, like with C++11-style<br>
attributes), and this patch is implemented to match that expectation.<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>