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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/constants-original.cc

Issue 2618543002: ParamVarDecl should never be renamed to kConstantStyle. (Closed)
Patch Set: Using: clang::isa<clang::ParmVarDecl>(&decl) 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 unified diff | Download patch
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/constants-expected.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 namespace blink { 5 namespace blink {
6 6
7 // Simple global constants. 7 // Simple global constants.
8 const char helloWorldConstant[] = "Hello world!"; 8 const char helloWorldConstant[] = "Hello world!";
9 // Make sure a one-character constant doesn't get mangled. 9 // Make sure a one-character constant doesn't get mangled.
10 const float e = 2.718281828; 10 const float e = 2.718281828;
(...skipping 24 matching lines...) Expand all
35 kFunctionConstant + kFunctionConstantFromExpression; 35 kFunctionConstant + kFunctionConstantFromExpression;
36 // These don't do the right thing right now, but names like this don't 36 // These don't do the right thing right now, but names like this don't
37 // exist in blink (hopefully). 37 // exist in blink (hopefully).
38 const int should_be_renamed_to_a_const = 9 - 2; 38 const int should_be_renamed_to_a_const = 9 - 2;
39 const int should_also_be_renamed_to_a_const = 39 const int should_also_be_renamed_to_a_const =
40 kFunctionConstant + kFunctionConstantFromOtherConsts; 40 kFunctionConstant + kFunctionConstantFromOtherConsts;
41 const int not_compile_time_const = kFunctionConstant + Function(); 41 const int not_compile_time_const = kFunctionConstant + Function();
42 } 42 }
43 }; 43 };
44 44
45 void F() { 45 // |constParam| should not be renamed to |kConstParam|.
46 void F(const bool constParam = true) {
46 // Constant in function body. 47 // Constant in function body.
47 static const char staticString[] = "abc"; 48 static const char staticString[] = "abc";
48 // Constant-style naming, since it's initialized with a literal. 49 // Constant-style naming, since it's initialized with a literal.
49 const char* const nonStaticStringConstant = "def"; 50 const char* const nonStaticStringConstant = "def";
50 // Not constant-style naming, since it's not initialized with a literal. 51 // Not constant-style naming, since it's not initialized with a literal.
51 const char* const nonStaticStringUnconstant = nonStaticStringConstant; 52 const char* const nonStaticStringUnconstant = nonStaticStringConstant;
52 } 53 }
53 54
54 } // namespace blink 55 } // namespace blink
OLDNEW
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/constants-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698