public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/2] add GCC_FINAL to ansidecl.h
@ 2015-08-10 12:05 tbsaunde+gcc
  2015-08-10 12:06 ` [PATCH 2/2] replace several uses of the anon namespace with GCC_FINAL tbsaunde+gcc
  2015-08-11 19:22 ` [PATCH 1/2] add GCC_FINAL to ansidecl.h Jeff Law
  0 siblings, 2 replies; 18+ messages in thread
From: tbsaunde+gcc @ 2015-08-10 12:05 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

Hi,

This allows classes and virtual functions to be marked as final if the compiler
supports C++11, or is gcc 4.7 or later.

bootstrapped + regtested on x86_64-linux-gnu, ok?

Trev

include/ChangeLog:

2015-08-10  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* ansidecl.h (GCC_FINAL): New macro.
---
 include/ansidecl.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/ansidecl.h b/include/ansidecl.h
index 224627d..6e4bfc2 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -313,6 +313,15 @@ So instead we use the macro below and test it against specific values.  */
 #define ENUM_BITFIELD(TYPE) unsigned int
 #endif
 
+    /* This is used to mark a class or virtual function as final.  */
+#if __cplusplus >= 201103L
+#define GCC_FINAL final
+#elif GCC_VERSION >= 4007
+#define GCC_FINAL __final
+#else
+#define GCC_FINAL
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.4.0

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] replace several uses of the anon namespace with GCC_FINAL
@ 2015-08-12 19:31 David Edelsohn
  2015-08-12 20:30 ` Trevor Saunders
  0 siblings, 1 reply; 18+ messages in thread
From: David Edelsohn @ 2015-08-12 19:31 UTC (permalink / raw)
  To: tbsaunde+gcc; +Cc: GCC Patches

This patch has caused a bootstrap failure on AIX.

- David

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-08-14 22:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-10 12:05 [PATCH 1/2] add GCC_FINAL to ansidecl.h tbsaunde+gcc
2015-08-10 12:06 ` [PATCH 2/2] replace several uses of the anon namespace with GCC_FINAL tbsaunde+gcc
2015-08-10 13:56   ` Markus Trippelsdorf
2015-08-10 14:45     ` Trevor Saunders
2015-08-11 19:23   ` Jeff Law
2015-08-12 18:57     ` Richard Sandiford
2015-08-12 19:03       ` Jeff Law
2015-08-12 20:36         ` Trevor Saunders
2015-08-13 17:33           ` Mikhail Maltsev
2015-08-14 22:56             ` Trevor Saunders
2015-08-13 20:23           ` Richard Sandiford
2015-08-12 23:58         ` Markus Trippelsdorf
2015-08-13  1:05           ` David Malcolm
2015-08-11 19:22 ` [PATCH 1/2] add GCC_FINAL to ansidecl.h Jeff Law
2015-08-12 19:31 [PATCH 2/2] replace several uses of the anon namespace with GCC_FINAL David Edelsohn
2015-08-12 20:30 ` Trevor Saunders
2015-08-13 11:28   ` David Edelsohn
2015-08-13 14:51   ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).