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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/template-expected.cc

Issue 2256913002: Handling of DependentScopeDeclRefExpr and CXXDependentScopeMemberExpr nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-style-new-clang
Patch Set: Created 4 years, 4 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
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 namespace not_blink { 5 namespace not_blink {
6 6
7 void function(int x) {} 7 void function(int x) {}
8 8
9 class Class { 9 class Class {
10 public: 10 public:
11 void method() {} 11 void method() {}
12 template <typename T> 12 template <typename T>
13 void methodTemplate(T) {} 13 void methodTemplate(T) {}
14 template <typename T> 14 template <typename T>
15 static void staticMethodTemplate(T) {} 15 static void staticMethodTemplate(T) {}
16 }; 16 };
17 17
18 template <typename T> 18 template <typename T>
19 void functionTemplate(T x) {} 19 void functionTemplate(T x) {}
20 20
21 template <typename T = Class>
22 void functionTemplate2() {
23 T::staticMethodTemplate(123);
24 }
25
26 template <typename T = Class>
27 class TemplatedClass {
28 public:
29 void anotherMethod() { T::staticMethodTemplate(123); }
30 };
31
Łukasz Anforowicz 2016/08/17 22:45:09 Test that DependentScopeDeclRefExpr and CXXDepende
21 } // not_blink 32 } // not_blink
22 33
23 namespace blink { 34 namespace blink {
24 35
25 template <typename T, int number> 36 template <typename T, int number>
26 void F() { 37 void F() {
27 // We don't assert on this, and we don't end up considering it a const for 38 // We don't assert on this, and we don't end up considering it a const for
28 // now. 39 // now.
29 const int maybe_a_const = sizeof(T); 40 const int maybe_a_const = sizeof(T);
30 const int is_a_const = number; 41 const int is_a_const = number;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 Class c; 144 Class c;
134 c.F(x); 145 c.F(x);
135 // Non-Blink should stay the same. 146 // Non-Blink should stay the same.
136 not_blink::Class c2; 147 not_blink::Class c2;
137 c2.method(x); 148 c2.method(x);
138 } 149 }
139 }; 150 };
140 151
141 } // namespace test_template_arg_is_method_template_in_member_context 152 } // namespace test_template_arg_is_method_template_in_member_context
142 153
154 namespace test_new_array_bug {
155
156 class PartitionAllocator {
157 public:
158 static void Method() {}
159 };
160
161 template <typename Allocator = PartitionAllocator>
162 class Vector {
163 public:
164 // https://crbug.com/584117: |method| below should be renamed to |Method|.
165 // |Allocator::method| is a CXXDependentScopeMemberExpr.
166 void AnotherMethod() { Allocator::Method(); }
167 };
168
169 template <typename Allocator = PartitionAllocator>
170 void Test() {
171 // https://crbug.com/584117: |method| below should be renamed to |Method|.
172 // |Allocator::method| is a DependentScopeDeclRefExpr.
173 Allocator::Method();
174 }
175
176 } // namespace test_new_array_bug
177
143 } // namespace blink 178 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698