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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/fields-expected.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-expected.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc b/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc
index a739b7dcb73c217669711b10f9620b13f4e2dd10..75796d70916237f5207e54bfb41a672516e008d3 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc
@@ -93,6 +93,36 @@ class TypeTrait2<void> {
static const bool value = false;
};
+template <typename T, typename U>
dcheng 2016/09/01 21:04:22 Please add some comments to this test (e.g. what s
Łukasz Anforowicz 2016/09/01 21:39:45 Done.
+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