[PATCH] D37436: Initial implementation of C attributes (WG14 N2137)

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 11:49:53 PDT 2017


rsmith added a comment.

Accepting this under `-std=c2x` is premature. We don't even know whether there will be such a standard yet, and this has not been voted into a working draft. But the `-f` flag form is OK.



================
Comment at: include/clang/Driver/Options.td:607
 
+def fcattributes : Flag<["-"], "fc-attributes">, Group<f_Group>,
+  Flags<[DriverOption, CC1Option]>, HelpText<"Enable '[[]]' attributes in C">;
----------------
Missing underscore between "fc" and "attributes".


================
Comment at: lib/Parse/ParseDecl.cpp:1512
 /// should try to parse it.
-bool Parser::DiagnoseProhibitedCXX11Attribute() {
+bool Parser::DiagnoseProhibitedAttribute() {
   assert(Tok.is(tok::l_square) && NextToken().is(tok::l_square));
----------------
This name should still reference the syntax used, since it is specific to [[...]] attribute syntax. Calling that CXX11 attribute syntax (even when used in C) doesn't seem overly confusing to me. If you want a different name for this, I'd be OK with that, but it should not be simply "Attribute".


https://reviews.llvm.org/D37436





More information about the cfe-commits mailing list