Reviewers: Mads Ager, Kasper Lund,

Description:
For some reason gcc didn't like a STATIC_ASSERT argument with '>' in
it, because it confused parsing of the template that STATIC_ASSERT
expands to.

It's all too magical for me.

Please review this at http://codereview.chromium.org/11468

SVN Base: http://v8.googlecode.com/svn/branches/experimental/toiger/

Affected files:
   M     src/checks.h
   M     src/virtual-frame-ia32.h


Index: src/virtual-frame-ia32.h
===================================================================
--- src/virtual-frame-ia32.h    (revision 788)
+++ src/virtual-frame-ia32.h    (working copy)
@@ -52,7 +52,6 @@
    Type type() const { return static_cast<Type>(type_ & kTypeMask); }

    bool is_dirty() const {
-    STATIC_ASSERT(kDirtyBit > LAST_TYPE);
      return (type_ & kDirtyBit) != 0;
    }

@@ -75,6 +74,8 @@
    static const int kDirtyBit = 1 << 8;
    static const int kTypeMask = kDirtyBit - 1;

+  STATIC_ASSERT(kDirtyBit > LAST_TYPE);
+
    // The element's type and a dirty bit.  The dirty bit can be cleared
    // for non-memory elements to indicate that the element agrees with
    // the value in memory in the actual frame.
Index: src/checks.h
===================================================================
--- src/checks.h        (revision 787)
+++ src/checks.h        (working copy)
@@ -228,9 +228,9 @@
  // actually causes each use to introduce a new defined type with a
  // name depending on the source line.
  template <int> class StaticAssertionHelper { };
-#define  
STATIC_CHECK(test)                                                  \
-   
typedef                                                                   \
-     
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>(test)>)> \
+#define  
STATIC_CHECK(test)                                                    \
+   
typedef                                                                      
\
+     
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
      SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)





--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to