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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/fields-original.cc

Issue 2307643002: Account for the fact that some type traits have static methods. (Closed)
Patch Set: 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
Index: tools/clang/rewrite_to_chrome_style/tests/fields-original.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc b/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc
index 52dd12e079f776c7fce795993864c6bff2c31581..9fa8dfb54a1dfc429396858dd9ccf9414881d94d 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc
@@ -90,6 +90,36 @@ class TypeTrait2<void> {
static const bool value = false;
};
+template <typename T, typename U>
+struct IsSubclass {
+ private:
+ typedef char YesType;
+ struct NoType {
+ char padding[8];
+ };
+
+ static YesType subclassCheck(U*);
+ static NoType subclassCheck(...);
+ static T* t;
+
+ public:
+ static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType);
+};
+
+template <typename U = void>
+struct IsTraceableInCollection {
+ // Expanded from STATIC_ONLY(IsTraceableInCollection):
+ private:
+ IsTraceableInCollection() = delete;
+ IsTraceableInCollection(const IsTraceableInCollection&) = delete;
+ IsTraceableInCollection& operator=(const IsTraceableInCollection&) = delete;
+ void* operator new(unsigned long) = delete;
+ void* operator new(unsigned long, void*) = delete;
+
+ public:
+ static const bool value = true;
+};
+
}; // namespace WTF
void F() {

Powered by Google App Engine
This is Rietveld 408576698