On 09/21/2016 02:59 PM, Marek Polacek wrote:
+ if (statement == NULL_TREE
+ && attr != NULL_TREE
+ && maybe_attribute_fallthrough_p (attr))
+ {
+ /* Turn [[fallthrough]]; into FALLTHROUGH ();. */
+ statement = build_call_expr_internal_loc (loc, IFN_FALLTHROUGH,
+ void_type_node, 0);
+ attr = NULL_TREE;
+ }
+
+ /* Allow "[[fallthrough]];", but warn otherwise. */
+ if (attr != NULL_TREE)
+ warning_at (loc, OPT_Wattributes,
+ "attributes at the beginning of statement are ignored");
This is very close, thanks. Let's give a more helpful warning about
[[fallthrough]] 0;
__attribute__ ((fallthrough)) 0;
both here and in cp_parser_statement, something like "fallthrough
attribute not followed by ';'"
Jason