This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix -std=c++11 -std=gnu++11 option handling (PR c++/77948)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 29 Oct 2016 12:41:43 -0400
- Subject: Re: [C++ PATCH] Fix -std=c++11 -std=gnu++11 option handling (PR c++/77948)
- Authentication-results: sourceware.org; auth=none
- References: <20161029160907.GZ3541@tucnak.redhat.com>
On Sat, Oct 29, 2016 at 12:09 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Apparently the driver reorders the options, -std=* options come before
> all -f* options, so both of the following patches work the same, except
> when cc1plus is invoked by hand. The first (inlined) patch solves it
> more in line how e.g. -fgnu-keywords and similar options are handled, so I think
> it is preferable (and I've successfully bootstrapped/regtested it on
> x86_64-linux and i686-linux). The second (attached) patch handles it
> by not clearing -fext-numeric-literals during option processing
> for -std=* options, just in post option handling clears it for the
> strict c++11+ modes if the option is not specified explicitly.
> If the driver wouldn't reorder the options, it would handle better
> cases like -fext-numeric-literals -std=c++11 to mean the same thing
> as -std=c++11 -fext-numeric-literals etc., but due to the reordering
> it isn't needed and for consistency we'd also need to change -fgnu-keywords
> etc.
I lean toward the second patch because it keeps the logic in a single
place, but it looks like it doesn't currently handle C++98
differently. I don't think we need to change the handling of other
options to match.
Jason