summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorpalves <palves@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-14 15:25:35 +0000
committerpalves <palves@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-14 15:25:35 +0000
commiteb133d34387789633db1e8dd5af7325325b84453 (patch)
tree45a755a4272a916085fe367cdfd7a6495ab76611 /include
parent3ea7a5e2c101b1a9ab4f4138cc5461fa6e14a628 (diff)
downloadgcc-eb133d34387789633db1e8dd5af7325325b84453.tar.gz
FINAL/OVERRIDE: Define to empty on g++ < 4.7
final/override were only implemented in g++ 4.7. include/ChangeLog 2016-10-14 Pedro Alves <palves@redhat.com> * ansidecl.h [__cplusplus >= 201103 && GCC_VERSION < 4007] (FINAL, OVERRIDE): Define as empty. [__cplusplus < 201103 && GCC_VERSION < 4007] (FINAL): Define as __final. [__cplusplus < 201103 && GCC_VERSION >= 4007] (OVERRIDE): Define as empty. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog9
-rw-r--r--include/ansidecl.h20
2 files changed, 24 insertions, 5 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 18bc5ff8d96..10826d8d9d3 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,14 @@
2016-10-14 Pedro Alves <palves@redhat.com>
+ * ansidecl.h [__cplusplus >= 201103 && GCC_VERSION < 4007] (FINAL,
+ OVERRIDE): Define as empty.
+ [__cplusplus < 201103 && GCC_VERSION < 4007] (FINAL): Define as
+ __final.
+ [__cplusplus < 201103 && GCC_VERSION >= 4007] (OVERRIDE): Define as
+ empty.
+
+2016-10-14 Pedro Alves <palves@redhat.com>
+
* ansidecl.h (GCC_FINAL): Delete.
(OVERRIDE, FINAL): New, moved from gcc/coretypes.h.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index ee934216f07..08aeb1eeb35 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -329,13 +329,23 @@ So instead we use the macro below and test it against specific values. */
this by default (actually GNU++14). */
#if __cplusplus >= 201103
-/* C++11 claims to be available: use it: */
-#define OVERRIDE override
-#define FINAL final
+/* C++11 claims to be available: use it. final/override were only
+ implemented in 4.7, though. */
+# if GCC_VERSION < 4007
+# define OVERRIDE
+# define FINAL
+# else
+# define OVERRIDE override
+# define FINAL final
+# endif
+#elif GCC_VERSION >= 4007
+/* G++ 4.7 supports __final in C++98. */
+# define OVERRIDE
+# define FINAL __final
#else
/* No C++11 support; leave the macros empty: */
-#define OVERRIDE
-#define FINAL
+# define OVERRIDE
+# define FINAL
#endif
#ifdef __cplusplus