Bug 830315 - Don't enable MOZ_FINAL and MOZ_DELETE on clang unless compiling as C++11. r=Waldo
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 15 Jan 2013 10:12:49 +0100
changeset 128752 1c7bdeefa8ee217167136e83fe9534c6195c7a9f
parent 128751 136b90350752b6e77ad0e019e2a9c4d6287f3221
child 128753 6c19a18336938f44f9d9266e481a7818bac074f5
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs830315
milestone21.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 830315 - Don't enable MOZ_FINAL and MOZ_DELETE on clang unless compiling as C++11. r=Waldo
mfbt/Attributes.h
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -58,22 +58,24 @@
    /*
     * Per Clang documentation, "Note that marketing version numbers should not
     * be used to check for language features, as different vendors use different
     * numbering schemes. Instead, use the feature checking macros."
     */
 #  ifndef __has_extension
 #    define __has_extension __has_feature /* compatibility, for older versions of clang */
 #  endif
-#  if __has_extension(cxx_deleted_functions)
-#    define MOZ_HAVE_CXX11_DELETE
-#  endif
-#  if __has_extension(cxx_override_control)
-#    define MOZ_HAVE_CXX11_OVERRIDE
-#    define MOZ_HAVE_CXX11_FINAL         final
+#  if __cplusplus >= 201103L
+#    if __has_extension(cxx_deleted_functions)
+#      define MOZ_HAVE_CXX11_DELETE
+#    endif
+#    if __has_extension(cxx_override_control)
+#      define MOZ_HAVE_CXX11_OVERRIDE
+#      define MOZ_HAVE_CXX11_FINAL         final
+#    endif
 #  endif
 #  if __has_extension(cxx_strong_enums)
 #    define MOZ_HAVE_CXX11_ENUM_TYPE
 #    define MOZ_HAVE_CXX11_STRONG_ENUMS
 #  endif
 #  if __has_attribute(noinline)
 #    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))
 #  endif