Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp

Issue 1612223002: rewrite_to_chrome_style: Handle non-method overloaded operators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rewrite-operators: commentfix Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/clang/rewrite_to_chrome_style/tests/operators-expected.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
diff --git a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
index 78df7a35440638fd7cada77ecc3919c48000fcec..98b4c9453d376aa24450476a1991068f6e7e1443 100644
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -399,8 +399,16 @@ int main(int argc, const char* argv[]) {
// void g();
// };
// matches |f| but not |g|.
- auto function_decl_matcher =
- id("decl", functionDecl(unless(cxxMethodDecl()), in_blink_namespace));
+ auto function_decl_matcher = id(
+ "decl",
+ functionDecl(
+ unless(anyOf(
+ // Methods are covered by the method matchers.
+ cxxMethodDecl(),
+ // Out-of-line overloaded operators have special names and should
+ // never be renamed.
+ isOverloadedOperator())),
+ in_blink_namespace));
FunctionDeclRewriter function_decl_rewriter(&replacements);
match_finder.addMatcher(function_decl_matcher, &function_decl_rewriter);
« no previous file with comments | « no previous file | tools/clang/rewrite_to_chrome_style/tests/operators-expected.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698