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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/methods-original.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
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/methods-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/methods-original.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc b/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
index fbbf9c1717c7acdb40110388065a2ccf5005532a..1bd97fa556d6631d2faea97a24b5f50007a9991b 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
@@ -68,6 +68,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 m_ptr ? &Testable::m_ptr : 0; }
+
+ private:
+ int m_ptr;
+};
+
} // namespace blink
// Test that overrides from outside the Blink namespace are also updated.
@@ -96,6 +108,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 {
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698