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: Jeffrey Walton <noloader at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 27 Jul 2015 07:20:08 -0400
- Subject: Re: GCC support for C++ noexcept
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8nchUG7WGQEkg-nD0jvG2sOCaZhmfUTxrVz7d=c7eZXmA at mail dot gmail dot com> <CAH6eHdS9Ee6j46BJC=f6vkZFWDco=bL=iyHuNa2g+van2yg-Bg at mail dot gmail dot com>
- Reply-to: noloader at gmail dot com
On Mon, Jul 27, 2015 at 4:33 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 27 July 2015 at 02:10, Jeffrey Walton wrote:
>> GCC does not appear to define __cplusplus under MinGW, so I can't
>> perform the test __cpluplus >= 201103L.
>
> It defines it unconditionally on all platforms.
>
>> $ g++ -dM -E - < /dev/null | grep cplusplus
>> $
>>
>> $ g++ -std=c++11 -dM -E - < /dev/null | grep cplusplus
>> cc1.exe: warning: command line option '-std=c++11' is valid for
>> C++/ObjC++ but not for C [enabled by default]=
>
> This tells you you are running the C compiler not the C++ compiler.
>
> When reading from stdin g++ doesn't set the default language to C++ (I
> keep meaning to file an enhancement request in Bugzilla about this).
>
>> How do I test for the noexcept feature?
>
> Compile as C++ not C, using -x c++
Doh, thanks.... I've got to get more sleep before I start asking
questions on public mailing lists...
Jeff