Bug 748237. Only do the c++11 stuff for clang here, since otherwise we get scary warnings with gcc on android. r=luke
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 26 Apr 2012 00:43:00 -0400
changeset 92474 ecfe99b2c9cc0d813a3303649f7bd821596201dd
parent 92473 b1217ae2c2601fa9b32fe2cefd2ee65e5793b817
child 92475 1a38b48816c97943118f90500f9215da60468731
push id22533
push useremorley@mozilla.com
push dateThu, 26 Apr 2012 12:46:19 +0000
treeherdermozilla-central@811b1ce5f4b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs748237
milestone15.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 748237. Only do the c++11 stuff for clang here, since otherwise we get scary warnings with gcc on android. r=luke
js/public/Utility.h
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -842,17 +842,17 @@ namespace js {
  */
 template<typename T>
 class MoveRef {
   public:
     typedef T Referent;
     explicit MoveRef(T &t) : pointer(&t) { }
     T &operator*()  const { return *pointer; }
     T *operator->() const { return  pointer; }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(__clang__)
     /*
      * If MoveRef is used in a rvalue position (which is expected), we can
      * end up in a situation where, without this ifdef, we would try to pass
      * a T& to a move constructor, which fails. It is not clear if the compiler
      * should instead use the copy constructor, but for now this lets us build
      * with clang. See bug 689066 and llvm.org/pr11003 for the details.
      * Note: We can probably remove MoveRef completely once we are comfortable
      * using c++11.