This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Fix option handling when -std=gnu++14 is not used (PR 69865)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]