Message ID | HE1PR07MB09055E200A8D3B40C6D57FE2E4A00@HE1PR07MB0905.eurprd07.prod.outlook.com |
---|---|
State | New |
Headers | show |
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. Otherwise the changes look good to me. Jason
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
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.
On Fri, Feb 19, 2016 at 03:51:08PM +0000, Bernd Edlinger wrote: > --- gcc/cp/except.c (revision 233557) > +++ gcc/cp/except.c (working copy) > @@ -1040,7 +1040,7 @@ nothrow_libfn_p (const_tree fn) > unless the system headers are playing rename tricks, and if > they are, we don't want to be confused by them. */ > id = DECL_NAME (fn); > - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); > + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); Too long line. Jakub
On 19.02.2016 17:38, Jakub Jelinek wrote: > > - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); > > + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); > > Too long line. > > Jakub Oh, thanks. Consider it fixed. Also the typo in the ChangeLog: > 2016-02-19 Jakub Jelinek <jakub@redhat.com> > Bernd Edlinger <bernd.edlinger@hotmail.de> > > * Make-lang.in: Invoke gpref with -L C++. We invoke gperf of course. Bernd.
2016-02-19 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/69865 * c-opts.c (c_common_post_options): Move call to set_std_cxx14 from here... (c_common_init_options): ...to here. (set_std_cxx98): Initialize flag_isoc94 and flag_isoc99. Index: gcc/c-family/c-opts.c =================================================================== --- gcc/c-family/c-opts.c (revision 233557) +++ gcc/c-family/c-opts.c (working copy) @@ -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; } @@ -802,10 +806,6 @@ c_common_post_options (const char **pfilename) && flag_no_builtin) flag_tree_loop_distribute_patterns = 0; - /* Set C++ standard to C++14 if not specified on the command line. */ - if (c_dialect_cxx () && cxx_dialect == cxx_unset) - set_std_cxx14 (/*ISO*/false); - /* -Woverlength-strings is off by default, but is enabled by -Wpedantic. It is never enabled in C++, as the minimum limit is not normative in that standard. */ @@ -1519,6 +1519,8 @@ set_std_cxx98 (int iso) flag_no_gnu_keywords = iso; flag_no_nonansi_builtin = iso; flag_iso = iso; + flag_isoc94 = 0; + flag_isoc99 = 0; cxx_dialect = cxx98; lang_hooks.name = "GNU C++98"; }