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

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

Issue 1776673006: rewrite_to_chrome_style: Add some additional macro test cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/macros-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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // Identifiers in macros should never be rewritten, as the risk of things 5 // Identifiers in macros should never be rewritten, as the risk of things
6 // breaking is extremely high. 6 // breaking is extremely high.
7 7
8 #define DEFINE_TYPE_CASTS(thisType, argumentType, argumentName, predicate) \ 8 #define DEFINE_TYPE_CASTS(thisType, argumentType, argumentName, predicate) \
9 inline thisType* to##thisType(argumentType* argumentName) { \ 9 inline thisType* to##thisType(argumentType* argumentName) { \
10 if (!predicate) \ 10 if (!predicate) \
(...skipping 19 matching lines...) Expand all
30 // a macro invocation. 30 // a macro invocation.
31 Derived* derivedPtr = toDerived(basePtr); 31 Derived* derivedPtr = toDerived(basePtr);
32 long long asInt = toInt(basePtr); 32 long long asInt = toInt(basePtr);
33 // 'derivedPtr' should be renamed: it's a reference to a declaration defined 33 // 'derivedPtr' should be renamed: it's a reference to a declaration defined
34 // outside a macro invocation. 34 // outside a macro invocation.
35 if (LIKELY(derivedPtr)) { 35 if (LIKELY(derivedPtr)) {
36 delete derivedPtr; 36 delete derivedPtr;
37 } 37 }
38 } 38 }
39 39
40 #define CALL_METHOD_FROM_MACRO() \
41 void callMethodFromMacro() { method(); } \
42 void pmethod() override {}
43
44 struct WithMacroP {
45 virtual void pmethod() {}
46 };
47
48 struct WithMacro : public WithMacroP {
49 void method() {}
50 CALL_METHOD_FROM_MACRO();
51 };
52
40 } // namespace blink 53 } // namespace blink
OLDNEW
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/macros-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698