This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add the latest C++ SD-6 additions.


I would like to put this patch out before Stage 1 ends even if there is bikeshed renaming of macros in the next couple weeks as the C++ committee wraps up after their meeting.

The main part of this patch is a __has_cpp_attribute macro.
#if __has_cpp_attribute(foobar)
#else
#endif

In C++ we can use namespaces as well:
#if __has_cpp_attribute(gnu::foobar)
#else
#endif

I also added __has_attribute with the same sematics as an extension since clang has it.
I made these available to C as well as C++.

There are also two C++98 flags in SD-6 added since most compilers allow one to switch these features off: __cpp_rtti, __cpp_exceptions. These are not defined if -fno-rtti -fno-exceptions respectively.

Also, the macro __cpp_attribute_deprecated has been removed in favor of __has_cpp_attribute(deprecated). Since __cpp_attribute_deprecated is out in the wild in the latest gcc-4.9 release perhaps I need to support this even if, in an ironic twist, __cpp_attribute_deprecated is deprecated. Let me know.

This builds clean on x86_64-linux.

Is this OK once it passes testing?

Ed

Attachment: CL_has_attribute
Description: Text document

Attachment: patch_has_attribute
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]