Commit 387a1d91 authored by dcheng's avatar dcheng Committed by Commit bot

rewrite_to_chrome_style: exclude conversion functions from being renamed

BUG=578344

Review URL: https://codereview.chromium.org/1617253002

Cr-Commit-Position: refs/heads/master@{#370802}
parent f581d48d
...@@ -432,9 +432,11 @@ int main(int argc, const char* argv[]) { ...@@ -432,9 +432,11 @@ int main(int argc, const char* argv[]) {
// Overloaded operators have special names // Overloaded operators have special names
// and should never be renamed. // and should never be renamed.
isOverloadedOperator(), isOverloadedOperator(),
// Similarly, constructors and destructors // Similarly, constructors, destructors, and
// should not be considered for renaming. // conversion functions should not be
cxxConstructorDecl(), cxxDestructorDecl())), // considered for renaming.
cxxConstructorDecl(), cxxDestructorDecl(),
cxxConversionDecl())),
in_blink_namespace)); in_blink_namespace));
// Note that the matcher for overridden methods doesn't need to filter for // Note that the matcher for overridden methods doesn't need to filter for
// special member functions: see implementation of FunctionDeclRewriter for // special member functions: see implementation of FunctionDeclRewriter for
......
...@@ -16,7 +16,12 @@ class Task { ...@@ -16,7 +16,12 @@ class Task {
// Note: this is purposely copyable and assignable, to make sure the Clang // Note: this is purposely copyable and assignable, to make sure the Clang
// tool doesn't try to emit replacements for things that aren't explicitly // tool doesn't try to emit replacements for things that aren't explicitly
// written. // written.
// TODO(dcheng): Add an explicit test for something like operator+.
// Overloaded operators should not be rewritten.
Task& operator++() { return *this; }
// Conversion functions should not be rewritten.
explicit operator int() const { return 42; }
}; };
// Test that the actual method definition is also updated. // Test that the actual method definition is also updated.
......
...@@ -16,7 +16,16 @@ class Task { ...@@ -16,7 +16,16 @@ class Task {
// Note: this is purposely copyable and assignable, to make sure the Clang // Note: this is purposely copyable and assignable, to make sure the Clang
// tool doesn't try to emit replacements for things that aren't explicitly // tool doesn't try to emit replacements for things that aren't explicitly
// written. // written.
// TODO(dcheng): Add an explicit test for something like operator+.
// Overloaded operators should not be rewritten.
Task& operator++() {
return *this;
}
// Conversion functions should not be rewritten.
explicit operator int() const {
return 42;
}
}; };
// Test that the actual method definition is also updated. // Test that the actual method definition is also updated.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment