danielmarjamaki created this revision. danielmarjamaki added a reviewer: alexfh. danielmarjamaki added a subscriber: cfe-commits.
This fixes the FP in http://llvm.org/bugs/show_bug.cgi?id=25208 http://reviews.llvm.org/D14540 Files: clang-tidy/misc/MacroParenthesesCheck.cpp test/clang-tidy/misc-macro-parentheses.cpp Index: test/clang-tidy/misc-macro-parentheses.cpp =================================================================== --- test/clang-tidy/misc-macro-parentheses.cpp +++ test/clang-tidy/misc-macro-parentheses.cpp @@ -34,6 +34,8 @@ #define GOOD23(type) (type::Field) #define GOOD24(t) std::set<t> s #define GOOD25(t) std::set<t,t,t> s +#define GOOD26(x) (a->*x) +#define GOOD27(x) (a.*x) // These are allowed for now.. #define MAYBE1 *12.34 Index: clang-tidy/misc/MacroParenthesesCheck.cpp =================================================================== --- clang-tidy/misc/MacroParenthesesCheck.cpp +++ clang-tidy/misc/MacroParenthesesCheck.cpp @@ -148,7 +148,8 @@ continue; // Argument is a struct member. - if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon)) + if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon, tok::arrowstar, + tok::periodstar)) continue; // Argument is a namespace or class.
Index: test/clang-tidy/misc-macro-parentheses.cpp =================================================================== --- test/clang-tidy/misc-macro-parentheses.cpp +++ test/clang-tidy/misc-macro-parentheses.cpp @@ -34,6 +34,8 @@ #define GOOD23(type) (type::Field) #define GOOD24(t) std::set<t> s #define GOOD25(t) std::set<t,t,t> s +#define GOOD26(x) (a->*x) +#define GOOD27(x) (a.*x) // These are allowed for now.. #define MAYBE1 *12.34 Index: clang-tidy/misc/MacroParenthesesCheck.cpp =================================================================== --- clang-tidy/misc/MacroParenthesesCheck.cpp +++ clang-tidy/misc/MacroParenthesesCheck.cpp @@ -148,7 +148,8 @@ continue; // Argument is a struct member. - if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon)) + if (Prev.isOneOf(tok::period, tok::arrow, tok::coloncolon, tok::arrowstar, + tok::periodstar)) continue; // Argument is a namespace or class.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits