This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix option handling when -std=gnu++14 is not used (PR 69865)
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Jakub Jelinek <jakub at redhat dot com>, Jason Merrill <jason at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>
- Date: Fri, 19 Feb 2016 16:19:39 +0000
- Subject: Re: [C++ PATCH] Fix option handling when -std=gnu++14 is not used (PR 69865)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=hotmail.de;
- References: <HE1PR07MB09054F1EE94A5C0E57E41AAEE4A00 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <20160219113126 dot GB3017 at tucnak dot redhat dot com> <HE1PR07MB09050AD7717125F4428FF773E4A00 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <20160219115945 dot GC3017 at tucnak dot redhat dot com> <20160219122212 dot GD3017 at tucnak dot redhat dot com> <20160219122646 dot GE3017 at tucnak dot redhat dot com> <HE1PR07MB0905E05119CA05C3C4652068E4A00 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <20160219152243 dot GP3017 at tucnak dot redhat dot com> <HE1PR07MB09055E200A8D3B40C6D57FE2E4A00 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <56C73CCB dot 4070709 at redhat dot com> <20160219160958 dot GQ3017 at tucnak dot redhat dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 19.02.2016 17:09, Jakub Jelinek wrote:
> On Fri, Feb 19, 2016 at 11:03:23AM -0500, Jason Merrill wrote:
>> On 02/19/2016 10:51 AM, Bernd Edlinger wrote:
>>> + flag_isoc94 = 0;
>>> + flag_isoc99 = 0;
>>
>> Why? These flags are global variables, so they're already zero-initialized.
>
> That is true, but those global variables could have changed earlier.
> Don't they e.g. get set if you do:
> -std=c++14 -std=c++98
> ?
>
> Jakub
>
These are zero-initialized, but this:
@@ -246,6 +246,10 @@ c_common_init_options (unsigned int decoded_option
}
}
+ /* Set C++ standard to C++14 if not specified on the command line. */
+ if (c_dialect_cxx ())
+ set_std_cxx14 (/*ISO*/false);
+
global_dc->colorize_source_p = true;
}
.. initializes them to 1, which is the default until we see
a -std=c++03.
I got 2 test cases FAIL without that hunk.
c-c++common/Wshift-negative-value-6.c and another similar one,
which I don't remember in the moment.
Bernd.