This is the mail archive of the gcc-help@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]

Re: GCC support for C++ noexcept


On 7/27/2015 10:36 AM, Jeffrey Walton wrote:
On Mon, Jul 27, 2015 at 9:48 AM, Edward Diener
<eldlistmailingz@tropicsoft.com> wrote:
On 7/27/2015 4:34 AM, Jonathan Wakely wrote:

On 27 July 2015 at 05:17, Edward Diener wrote:

Try

#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
// C++11 is in effect
#endif

GCC 4.8 defines __cplusplus to the correct YYYYMMDD value so this is
not necessary.


I meant it as a general solution for any version of gcc. It is what Boost
config uses.

__GXX_EXPERIMENTAL_CXX0X breaks on Apple platforms and some Clang
based gear. Been there, done that....

I do say "I meant it as a general solution for any version of gcc."

Boost detects clang, and any other gcc derivative, separately from gcc, so the code I presented has nothing to do with clang, since it is in a header file where the compiler is known to be gcc. I agree that if you could be compiling for clang or another gcc derivative compiler the code I presented may not by itself be enough if that compiler either defined __GXX_EXPERIMENTAL_CXX0X__ when C++11 support is not implemented or if that compiler has some other specific way of indicating C++11 support.

if __GXX_EXPERIMENTAL_CXX0X is defined on Apple platforms for gcc when C++11 is not supported I would definitely like to know more about that scenario.



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