Bug 1142999 - Remove gcc warning about unused typedef. r=ehoogeveen
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 25 Mar 2015 09:47:00 -0400
changeset 264832 7e3c6bc1ade6b23a5f48e23ea196a9a1383f55ef
parent 264831 90cef983391a50a3ce7a3acfec1224c57ea522e0
child 264833 6c08aa7c7142a7f3643aa77c962ed4c6e464dbc0
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehoogeveen
bugs1142999
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1142999 - Remove gcc warning about unused typedef. r=ehoogeveen
mfbt/EnumeratedRange.h
--- a/mfbt/EnumeratedRange.h
+++ b/mfbt/EnumeratedRange.h
@@ -194,17 +194,19 @@ private:
 #  pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
 
 // Create a range to iterate from aBegin to aEnd, exclusive.
 template<typename IntType, typename EnumType>
 inline detail::EnumeratedRange<IntType, EnumType>
 MakeEnumeratedRange(EnumType aBegin, EnumType aEnd)
 {
+#ifdef DEBUG
   typedef typename MakeUnsigned<IntType>::Type UnsignedType;
+#endif
   static_assert(sizeof(IntType) >= sizeof(EnumType),
                 "IntType should be at least as big as EnumType!");
   MOZ_ASSERT(aBegin <= aEnd, "Cannot generate invalid, unbounded range!");
   MOZ_ASSERT_IF(aBegin < EnumType(0), IsSigned<IntType>::value);
   MOZ_ASSERT_IF(aBegin >= EnumType(0) && IsSigned<IntType>::value,
                 UnsignedType(aEnd) <= UnsignedType(MaxValue<IntType>::value));
   return detail::EnumeratedRange<IntType, EnumType>(aBegin, aEnd);
 }