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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc

Issue 1765783002: rewrite_to_chrome_style: Rewrite references to members through the class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rewrite-non-member-members: . Created 4 years, 10 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
Index: tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc b/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
index 4d76c3655dbe1fff5c76772fac5fc2e0832fd19a..c45df9987fc349cbb155ecf1f5e7313f0f21e630 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
@@ -64,6 +64,18 @@ void Task::DoTheWork() {
ReallyDoTheWork();
}
+template <typename T>
+class Testable {
+ public:
+ typedef T Testable::*UnspecifiedBoolType;
+ // This method has a reference to a member in a "member context" and a
+ // "non-member context" to verify both are rewritten.
+ operator UnspecifiedBoolType() { return ptr_ ? &Testable::ptr_ : 0; }
+
+ private:
+ int ptr_;
+};
+
} // namespace blink
// Test that overrides from outside the Blink namespace are also updated.
@@ -92,6 +104,12 @@ void F() {
void (BovineTask::*p4)() = &BovineTask::ReallyDoTheWork;
}
+bool G() {
+ // Use the Testable class to rewrite the method.
+ blink::Testable<int> tt;
+ return tt;
+}
+
namespace blink {
struct StructInBlink {

Powered by Google App Engine
This is Rietveld 408576698