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

Unified Diff: src/base/macros.h

Issue 613143004: Changes to ALLOW_UNUSED to match upcoming changes to the Chromium trunk: (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Missed one Created 6 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 | « src/base/flags.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/macros.h
diff --git a/src/base/macros.h b/src/base/macros.h
index cef088cb8194497eb0a86dfee1720c981a666bd6..d28ebf30430875e96d36dfc9cb5c31847fc15720 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -130,7 +130,7 @@ struct CompileAssert {};
#define COMPILE_ASSERT(expr, msg) \
typedef CompileAssert<static_cast<bool>(expr)> \
- msg[static_cast<bool>(expr) ? 1 : -1] ALLOW_UNUSED
+ msg[static_cast<bool>(expr) ? 1 : -1] ALLOW_UNUSED_TYPE
// Implementation details of COMPILE_ASSERT:
//
@@ -150,23 +150,11 @@ struct CompileAssert {};
// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is
// // not a compile-time constant.
//
-// - By using the type CompileAssert<(bool(expr))>, we ensures that
+// - By using the type CompileAssert<static_cast<bool>(expr)>, we ensure that
// expr is a compile-time constant. (Template arguments must be
// determined at compile-time.)
//
-// - The outer parentheses in CompileAssert<(bool(expr))> are necessary
-// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
-//
-// CompileAssert<bool(expr)>
-//
-// instead, these compilers will refuse to compile
-//
-// COMPILE_ASSERT(5 > 0, some_message);
-//
-// (They seem to think the ">" in "5 > 0" marks the end of the
-// template argument list.)
-//
-// - The array size is (bool(expr) ? 1 : -1), instead of simply
+// - The array size is (static_cast<bool>(expr) ? 1 : -1), instead of simply
//
// ((expr) ? 1 : -1).
//
@@ -311,7 +299,7 @@ template <int> class StaticAssertionHelper { };
#define STATIC_ASSERT(test) \
typedef \
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
- SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) ALLOW_UNUSED
+ SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) ALLOW_UNUSED_TYPE
#endif
« no previous file with comments | « src/base/flags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698