Bug 987290 - Work around a GCC 4.6.3 ICE - no review, bustage fix
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 28 Apr 2014 12:27:13 -0400
changeset 180975 ae2b85aaa9f31e15ad44c2819cd99c1595a9d094
parent 180974 e94f5aaf895081d2dcb4ecd71dfcf2e170b5adbe
child 180976 8dda04e44e3e0e8aad285c7bb4396ffc1d9e85a3
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
bugs987290
milestone31.0a1
Bug 987290 - Work around a GCC 4.6.3 ICE - no review, bustage fix
mfbt/tests/TestTypedEnum.cpp
--- a/mfbt/tests/TestTypedEnum.cpp
+++ b/mfbt/tests/TestTypedEnum.cpp
@@ -270,29 +270,29 @@ void TestBinOp(const T1& t1, const T2& t
 
   RequireLiteralType<ResultType>();
   TestNonConvertibilityForOneType<ResultType>();
 
   UnsignedIntegerType unsignedIntegerResult
     = Op<o>(UnsignedIntegerType(t1), UnsignedIntegerType(t2));
 
   MOZ_RELEASE_ASSERT(unsignedIntegerResult == UnsignedIntegerType(result));
-  MOZ_RELEASE_ASSERT(unsignedIntegerResult == UnsignedIntegerType(TypedEnum(result)));
+  MOZ_RELEASE_ASSERT(TypedEnum(unsignedIntegerResult) == TypedEnum(result));
   MOZ_RELEASE_ASSERT((!unsignedIntegerResult) == (!result));
   MOZ_RELEASE_ASSERT((!!unsignedIntegerResult) == (!!result));
   MOZ_RELEASE_ASSERT(bool(unsignedIntegerResult) == bool(result));
 
   // Part 2:
   // Test the compound-assignment operator, i.e.
   //   result Op= t3;
   TypedEnum newResult = result;
   OpAssign<o>(newResult, t3);
   UnsignedIntegerType unsignedIntegerNewResult = unsignedIntegerResult;
   OpAssign<o>(unsignedIntegerNewResult, UnsignedIntegerType(t3));
-  MOZ_RELEASE_ASSERT(unsignedIntegerNewResult == UnsignedIntegerType(newResult));
+  MOZ_RELEASE_ASSERT(TypedEnum(unsignedIntegerNewResult) == newResult);
 
   // Part 3:
   // Test additional boolean operators that we unfortunately had to add to
   // CastableTypedEnumResult at some point to please some compiler,
   // even though bool convertibility should have been enough.
   MOZ_RELEASE_ASSERT(result == TypedEnum(result));
   MOZ_RELEASE_ASSERT(!(result != TypedEnum(result)));
   MOZ_RELEASE_ASSERT((result && true) == bool(result));
@@ -317,17 +317,17 @@ void TestTilde(const T& t)
   typedef decltype(result) ResultType;
 
   RequireLiteralType<ResultType>();
   TestNonConvertibilityForOneType<ResultType>();
 
   UnsignedIntegerType unsignedIntegerResult = ~(UnsignedIntegerType(t));
 
   MOZ_RELEASE_ASSERT(unsignedIntegerResult == UnsignedIntegerType(result));
-  MOZ_RELEASE_ASSERT(unsignedIntegerResult == UnsignedIntegerType(TypedEnum(result)));
+  MOZ_RELEASE_ASSERT(TypedEnum(unsignedIntegerResult) == TypedEnum(result));
   MOZ_RELEASE_ASSERT((!unsignedIntegerResult) == (!result));
   MOZ_RELEASE_ASSERT((!!unsignedIntegerResult) == (!!result));
   MOZ_RELEASE_ASSERT(bool(unsignedIntegerResult) == bool(result));
 }
 
 // Helper dispatching a given triple of operands to all operator-specific
 // testing functions.
 template<typename TypedEnum, typename T1, typename T2, typename T3>