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 dddccd1741bb968b0c99fec10af2bda8a3a5ec5a..34f17bbd2bfc9b8f25cf2c3ed4056926f186c5a8 100644 |
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
@@ -287,6 +287,13 @@ bool GetNameForDecl(const clang::FunctionDecl& decl, |
std::string& name) { |
name = decl.getName().str(); |
name[0] = clang::toUppercase(name[0]); |
+ |
+ // https://crbug.com/582312: Prepend "Get" if method name conflicts with type. |
+ const clang::IdentifierInfo* return_type = |
+ decl.getReturnType().getBaseTypeIdentifier(); |
+ if (return_type && return_type->getName() == name) |
+ name = "Get" + name; |
+ |
return true; |
} |