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

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

Issue 2640283003: Look at canonical decl, when deciding whether to rename or not. (Closed)
Patch Set: Fixed handling of function template specializations. 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
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 #include <type_traits> 5 #include <type_traits>
6 6
7 namespace not_blink { 7 namespace not_blink {
8 8
9 void function(int x) {} 9 void function(int x) {}
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 template <typename T> 331 template <typename T>
332 class IntrusiveHeap { 332 class IntrusiveHeap {
333 public: 333 public:
334 // https://crbug.com/672353: |begin| shouldn't be rewritten to |Begin|. 334 // https://crbug.com/672353: |begin| shouldn't be rewritten to |Begin|.
335 const T* begin() const { return nullptr; } 335 const T* begin() const { return nullptr; }
336 }; 336 };
337 337
338 } // namespace blacklisting_of_renaming_of_begin_method 338 } // namespace blacklisting_of_renaming_of_begin_method
339 339
340 namespace specializations {
341
342 template <unsigned long sizeOfValue>
343 int toV8SignedIntegerInternal(long value);
344
345 template <>
346 int toV8SignedIntegerInternal<4>(long value) {
347 return 123 + value;
348 }
349
350 template <>
351 int toV8SignedIntegerInternal<8>(long value) {
352 return 456 + value;
353 }
354
355 int toV8(int value) {
356 return toV8SignedIntegerInternal<sizeof value>(value);
357 }
358
359 int toV8(long value) {
360 return toV8SignedIntegerInternal<sizeof value>(value);
361 }
362
363 } // namespace specializations
364
340 } // namespace blink 365 } // namespace blink
341 366
342 namespace not_blink { 367 namespace not_blink {
343 368
344 namespace cxx_dependent_scope_member_expr_testing { 369 namespace cxx_dependent_scope_member_expr_testing {
345 370
346 class Base : public ::blink::cxx_dependent_scope_member_expr_testing::Class { 371 class Base : public ::blink::cxx_dependent_scope_member_expr_testing::Class {
347 public: 372 public:
348 virtual void virtualMethod() {} 373 virtual void virtualMethod() {}
349 }; 374 };
(...skipping 20 matching lines...) Expand all
370 // Need to rewrite |f| to |F| below (because this method name 395 // Need to rewrite |f| to |F| below (because this method name
371 // does get rewritten when processing blink::test_unnamed_arg::Class). 396 // does get rewritten when processing blink::test_unnamed_arg::Class).
372 // See also https://crbug.com/670434. 397 // See also https://crbug.com/670434.
373 output->f(123); 398 output->f(123);
374 } 399 }
375 }; 400 };
376 401
377 } // namespace blink_methods_called_from_mojo_traits_are_not_rewritten 402 } // namespace blink_methods_called_from_mojo_traits_are_not_rewritten
378 403
379 } // namespace not_blink 404 } // namespace not_blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698