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

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

Issue 2618543002: ParamVarDecl should never be renamed to kConstantStyle. (Closed)
Patch Set: Created 3 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/constants-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 83c6eb22e6270c918918efe1d359a41be0b4d2ba..90bcdb4981d40d0fa335be46f6f42445fade3e8a 100644
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -330,6 +330,11 @@ bool IsProbablyConst(const clang::VarDecl& decl,
if (type.isVolatileQualified())
return false;
+ // Parameters should not be renamed to |kFooBar| style (even if they are
+ // const and have an initializer (aka default value)).
+ if (clang::ParmVarDecl::classof(&decl))
dcheng 2017/01/04 23:21:31 Nit: more standard to write: clang::isa<clang::Pa
Łukasz Anforowicz 2017/01/04 23:30:43 Thanks. I was trying to recall/find how to spell
+ return false;
+
// http://google.github.io/styleguide/cppguide.html#Constant_Names
// Static variables that are const-qualified should use kConstantStyle naming.
if (decl.getStorageDuration() == clang::SD_Static)
« no previous file with comments | « no previous file | tools/clang/rewrite_to_chrome_style/tests/constants-expected.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698