[clang-tools-extra] r252608 - [clang-tidy] misc-macro-parentheses: fix fp when using object member pointers

Daniel Marjamaki via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 06:32:26 PST 2015


Author: danielmarjamaki
Date: Tue Nov 10 08:32:25 2015
New Revision: 252608

URL: http://llvm.org/viewvc/llvm-project?rev=252608&view=rev
Log:
[clang-tidy] misc-macro-parentheses: fix fp when using object member pointers

Fixes http://llvm.org/PR25208.


Modified:
    clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp?rev=252608&r1=252607&r2=252608&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp Tue Nov 10 08:32:25 2015
@@ -148,7 +148,8 @@ void MacroParenthesesPPCallbacks::argume
       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.

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp?rev=252608&r1=252607&r2=252608&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp Tue Nov 10 08:32:25 2015
@@ -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




More information about the cfe-commits mailing list