sammccall added a comment.

The documentation examples of MacroBlockBegin are:

  /// A regular expression matching macros that start a block.
  /// \code
  ///    # With:
  ///    MacroBlockBegin: "^NS_MAP_BEGIN|\
  ///    NS_TABLE_HEAD$"
  ///    MacroBlockEnd: "^\
  ///    NS_MAP_END|\
  ///    NS_TABLE_.*_END$"
  ///
  ///    NS_MAP_BEGIN
  ///      foo();
  ///    NS_MAP_END
  ///
  ///    NS_TABLE_HEAD
  ///      bar();
  ///    NS_TABLE_FOO_END
  ///
  ///    # Without:
  ///    NS_MAP_BEGIN
  ///    foo();
  ///    NS_MAP_END
  ///
  ///    NS_TABLE_HEAD
  ///    bar();
  ///    NS_TABLE_FOO_END
  /// \endcode

It doesn't appear that a semicolon after the macro is expected, so the 
semicolon is treated as an empty statement inside the block.

There are some reasonable arguments for this. semicolons go after 
statement-like things, block introducers are not statement-like in general. 
Even if the particular implementation requires a semicolon (e.g. `glBegin()`), 
it breaks abstraction to make the user type it, it should be part of the macro 
instead.

If this doesn't work for your codebase, can you share some details about the 
macro (what it's for and what it expands to) that motivates this change?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60308/new/

https://reviews.llvm.org/D60308



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to