Reviewers: Michael Achenbach,
Message:
Hey Michael,
These are macros from the pre-C++11 area, which are no longer used. Trivial
cleanup. Please take a look.
Thanks,
Benedikt
Description:
[c++11] Remove remnants of pre-C++11 delete, final and override.
These macros are not needed anymore, so there's no point in supporting
them.
Please review this at https://codereview.chromium.org/1123723003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+5, -37 lines):
M include/v8config.h
M src/base/macros.h
Index: include/v8config.h
diff --git a/include/v8config.h b/include/v8config.h
index
7723e42f878cd277bbdd3bcd65821aec2ebe8ac7..991a43afd445c066eda7d5fc6e5d56209a5a0cf4
100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -162,7 +162,6 @@
// V8_HAS_CXX11_ALIGNAS - alignas specifier supported
// V8_HAS_CXX11_ALIGNOF - alignof(type) operator supported
// V8_HAS_CXX11_STATIC_ASSERT - static_assert() supported
-// V8_HAS_CXX11_DELETE - deleted functions supported
//
// Compiler-specific feature detection
//
@@ -188,7 +187,6 @@
// V8_HAS_DECLSPEC_DEPRECATED - __declspec(deprecated) supported
// V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported
// V8_HAS_DECLSPEC_SELECTANY - __declspec(selectany) supported
-// V8_HAS___FINAL - __final supported in non-C++11
mode
// V8_HAS___FORCEINLINE - __forceinline supported
//
// Note that testing for compilers and/or features must be done using #if
@@ -228,7 +226,6 @@
# define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas))
# define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert))
-# define V8_HAS_CXX11_DELETE (__has_feature(cxx_deleted_functions))
#elif defined(__GNUC__)
@@ -270,12 +267,6 @@
# define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0))
# define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0))
# define V8_HAS_CXX11_STATIC_ASSERT (V8_GNUC_PREREQ(4, 3, 0))
-# define V8_HAS_CXX11_DELETE (V8_GNUC_PREREQ(4, 4, 0))
-# define V8_HAS_CXX11_OVERRIDE (V8_GNUC_PREREQ(4, 7, 0))
-# define V8_HAS_CXX11_FINAL (V8_GNUC_PREREQ(4, 7, 0))
-# else
-// '__final' is a non-C++11 GCC synonym for 'final', per GCC r176655.
-# define V8_HAS___FINAL (V8_GNUC_PREREQ(4, 7, 0))
# endif
#elif defined(_MSC_VER)
@@ -284,9 +275,6 @@
# define V8_HAS___ALIGNOF 1
-# define V8_HAS_CXX11_FINAL 1
-# define V8_HAS_CXX11_OVERRIDE 1
-
# define V8_HAS_DECLSPEC_ALIGN 1
# define V8_HAS_DECLSPEC_DEPRECATED 1
# define V8_HAS_DECLSPEC_NOINLINE 1
@@ -353,26 +341,6 @@ declarator __attribute__((deprecated))
#endif
-// A macro to specify that a method is deleted from the corresponding
class.
-// Any attempt to use the method will always produce an error at compile
time
-// when this macro can be implemented (i.e. if the compiler supports
C++11).
-// If the current compiler does not support C++11, use of the annotated
method
-// will still cause an error, but the error will most likely occur at link
time
-// rather than at compile time. As a backstop, method declarations using
this
-// macro should be private.
-// Use like:
-// class A {
-// private:
-// A(const A& other) V8_DELETE;
-// A& operator=(const A& other) V8_DELETE;
-// };
-#if V8_HAS_CXX11_DELETE
-# define V8_DELETE = delete
-#else
-# define V8_DELETE /* NOT SUPPORTED */
-#endif
-
-
// This macro allows to specify memory alignment for structs, classes, etc.
// Use like:
// class V8_ALIGNED(16) MyClass { ... };
Index: src/base/macros.h
diff --git a/src/base/macros.h b/src/base/macros.h
index
49ca386aabd7c788e59d2ab4c88277be55b70eb1..e98b4f569f2bab5bc91d691293089b12254ce157
100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -234,9 +234,9 @@ V8_INLINE Dest bit_cast(Source const& source) {
// A macro to disallow the evil copy constructor and operator= functions
// This should be used in the private: declarations for a class
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&) V8_DELETE; \
- void operator=(const TypeName&) V8_DELETE
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&) = delete; \
+ void operator=(const TypeName&) = delete
// A macro to disallow all the implicit constructors, namely the
@@ -245,8 +245,8 @@ V8_INLINE Dest bit_cast(Source const& source) {
// This should be used in the private: declarations for a class
// that wants to prevent anyone from instantiating it. This is
// especially useful for classes containing only static methods.
-#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
- TypeName() V8_DELETE; \
+#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
+ TypeName() = delete; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.