Index: clang-tidy/misc/MacroParenthesesCheck.cpp =================================================================== --- clang-tidy/misc/MacroParenthesesCheck.cpp +++ clang-tidy/misc/MacroParenthesesCheck.cpp @@ -148,7 +148,7 @@ continue; // Argument is a struct member. - if (Prev.isOneOf(tok::period, tok::arrow)) + if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon)) continue; // String concatenation. @@ -169,8 +169,8 @@ TI + 2 != MI->tokens_end() && (TI + 2)->is(tok::r_paren)) continue; - // Assignment. - if (Prev.is(tok::equal) && Next.is(tok::semi)) + // Assignment/Return, i.e. '=x;' or 'return x;'. + if (Prev.isOneOf(tok::equal, tok::kw_return) && Next.is(tok::semi)) continue; Check->diag(Tok.getLocation(), "macro argument should be enclosed in " Index: test/clang-tidy/misc-macro-parentheses.cpp =================================================================== --- test/clang-tidy/misc-macro-parentheses.cpp +++ test/clang-tidy/misc-macro-parentheses.cpp @@ -30,6 +30,8 @@ #define GOOD18(x) ;x; #define GOOD19 ;-2; #define GOOD20 void* +#define GOOD21(a) case Fred::a: +#define GOOD22(a) if (verbose) return a; // These are allowed for now.. #define MAYBE1 *12.34