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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/template-original.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: Rebasing... Created 4 years, 3 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 | « tools/clang/rewrite_to_chrome_style/tests/template-expected.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/rewrite_to_chrome_style/tests/template-original.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/template-original.cc b/tools/clang/rewrite_to_chrome_style/tests/template-original.cc
index cf221881833bee9f0bd615eeebaec949e024643c..59af938d81193a5f62a0d1a0fe1094a3361b4818 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/template-original.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/template-original.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <type_traits>
+
namespace not_blink {
void function(int x) {}
@@ -9,6 +11,7 @@ void function(int x) {}
class Class {
public:
void method() {}
+ virtual void virtualMethod() {}
template <typename T>
void methodTemplate(T) {}
template <typename T>
@@ -18,6 +21,17 @@ class Class {
template <typename T>
void functionTemplate(T x) {}
+template <typename T = Class>
+void functionTemplate2() {
+ T::staticMethodTemplate(123);
+}
+
+template <typename T = Class>
+class TemplatedClass {
+ public:
+ void anotherMethod() { T::staticMethodTemplate(123); }
+};
+
} // not_blink
namespace blink {
@@ -180,4 +194,63 @@ void foo() {
} // namespace test_unnamed_arg
+namespace test_new_array_bug {
+
+class PartitionAllocator {
+ public:
+ static void method() {}
+};
+
+template <typename Allocator = PartitionAllocator>
+class Vector {
+ public:
+ // https://crbug.com/582315: |Allocator::method| is a
+ // CXXDependentScopeMemberExpr.
+ void anotherMethod() {
+ if (std::is_class<Allocator>::value) // Shouldn't rename |value|
+ Allocator::method(); // Should rename |method| -> |Method|.
+ }
+};
+
+template <typename Allocator = PartitionAllocator>
+void test() {
+ // https://crbug.com/582315: |Allocator::method| is a
+ // DependentScopeDeclRefExpr.
+ if (std::is_class<Allocator>::value) // Shouldn't rename |value|.
+ Allocator::method(); // Should rename |method|.
+}
+
+class InterceptingCanvasBase : public ::not_blink::Class {
+ public:
+ virtual void virtualMethodInBlink(){};
+};
+
+template <typename DerivedCanvas>
+class InterceptingCanvas : public InterceptingCanvasBase {
+ public:
+ void virtualMethod() override {
+ this->Class::virtualMethod(); // https://crbug.com/582315#c19
+ this->InterceptingCanvasBase::virtualMethodInBlink();
+ }
+};
+
+template <typename T>
+class ThreadSpecific {
+ public:
+ T* operator->();
+ operator T*();
+};
+
+template <typename T>
+inline ThreadSpecific<T>::operator T*() {
+ return nullptr;
+}
+
+template <typename T>
+inline T* ThreadSpecific<T>::operator->() {
+ return operator T*();
+}
+
+} // namespace test_new_array_bug
+
} // namespace blink
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/template-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698