This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC support for C++ noexcept
- From: Edward Diener <eldlistmailingz at tropicsoft dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 4 Aug 2015 10:34:32 -0400
- Subject: Re: GCC support for C++ noexcept
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8nchUG7WGQEkg-nD0jvG2sOCaZhmfUTxrVz7d=c7eZXmA at mail dot gmail dot com> <20150727015526 dot GB58373 at unpythonic dot net> <CAH8yC8=PJLmO+Z-4L804wqTj2o3_W93ZynyUg6Hjj27EAChyfw at mail dot gmail dot com> <mp4bdj$rcd$1 at ger dot gmane dot org> <CAH6eHdS5818Hmd6TX5dyzfw8X3Aa1CyvvgNkDQb2hKSgThMoew at mail dot gmail dot com> <mp5csf$5pa$1 at ger dot gmane dot org> <CAH6eHdQrE62neEYvk-FgQ28eSLz6p6NDqJ=_DFXPvnTUH7p_yQ at mail dot gmail dot com> <mp63vc$rui$1 at ger dot gmane dot org> <CAH6eHdTVGsXeGWHBhsw_W=3Sneqbk-h9xg6v8S77+87eXGiMQA at mail dot gmail dot com> <mp6e6o$4l5$1 at ger dot gmane dot org> <CAH6eHdShTDd3=xQ62-SW7AH-Bw7QDpMGOG25_QG1KeHZR0=OXQ at mail dot gmail dot com>
On 7/28/2015 5:41 AM, Jonathan Wakely wrote:
On 28 July 2015 at 00:17, Edward Diener wrote:
I see your point. The code I mentioned should really be:
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__cplusplus) &&
__cplusplus >= 201103L
The defined(__cplusplus) check is redundant, an undefined token in a
preprocessor conditional is treated as 0.
You are right. Therefore, as I originally stated:
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
// C++11 is in effect
#endif
is correct to determine whether C++11 is in effect for any given version
of gcc. If you are compiling in C mode C++11 can never be in effect and
the check above reflects that. If you are compiling in C++ mode one or
the other being true will tell you that C++11 mode is being used.
I think what Boost config uses is correct for determining C++11 mode for
its own use. Of course what C++11 mode means for Boost config may be
different than what the OP means.