Bug 1203314 - Make operator<< a method on unused_t. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Thu, 10 Sep 2015 13:17:00 +0200
changeset 295147 f04c038de23638385e8652f84682eaf00cfa017f
parent 295146 b10bb607c2f0d42d863ad76a4a209536b27e67c9
child 295148 d5eaaf9ba224e6856ec3386a3e2ec2537b34889d
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1203314
milestone43.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 1203314 - Make operator<< a method on unused_t. r=froydnj This prevents operator overload resolution from failing when this file is included in a file that uses Chromium IPC logging.
mfbt/unused.h
--- a/mfbt/unused.h
+++ b/mfbt/unused.h
@@ -14,26 +14,23 @@
 namespace mozilla {
 
 //
 // Suppress GCC warnings about unused return values with
 //   unused << SomeFuncDeclaredWarnUnusedReturnValue();
 //
 struct unused_t
 {
+  template<typename T>
+  inline void
+  operator<<(const T& /*unused*/) const {}
 };
 
 extern MFBT_DATA const unused_t unused;
 
-template<typename T>
-inline void
-operator<<(const unused_t& /*unused*/, const T& /*unused*/)
-{
-}
-
 } // namespace mozilla
 
 #endif // __cplusplus
 
 // An alternative to mozilla::unused for use in (a) C code and (b) code where
 // linking with unused.o is difficult.
 #define MOZ_UNUSED(expr) \
   do { if (expr) { (void)0; } } while (0)