[PATCH] D14540: clang-tidy: Fix FP in MacroParenthesesChecker when using object member pointer

Daniel Marjamäki via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 04:59:53 PST 2015


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14540.39805.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151110/9a3d0f66/attachment.bin>


More information about the cfe-commits mailing list