Commit aa9f4b4c by Marek Polacek Committed by Marek Polacek

c-opts.c (c_common_post_options): Set C++ standard earlier, before setting various warnings.

	* c-opts.c (c_common_post_options): Set C++ standard earlier, before
	setting various warnings.

From-SVN: r227744
parent aa256c4a
2015-09-14 Marek Polacek <polacek@redhat.com> 2015-09-14 Marek Polacek <polacek@redhat.com>
* c-opts.c (c_common_post_options): Set C++ standard earlier, before
setting various warnings.
2015-09-14 Marek Polacek <polacek@redhat.com>
* c-common.c (warn_for_sign_compare): Cast to unsigned when shifting * c-common.c (warn_for_sign_compare): Cast to unsigned when shifting
a negative value. a negative value.
......
...@@ -800,6 +800,10 @@ c_common_post_options (const char **pfilename) ...@@ -800,6 +800,10 @@ c_common_post_options (const char **pfilename)
&& flag_no_builtin) && flag_no_builtin)
flag_tree_loop_distribute_patterns = 0; 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. /* -Woverlength-strings is off by default, but is enabled by -Wpedantic.
It is never enabled in C++, as the minimum limit is not normative It is never enabled in C++, as the minimum limit is not normative
in that standard. */ in that standard. */
...@@ -887,10 +891,6 @@ c_common_post_options (const char **pfilename) ...@@ -887,10 +891,6 @@ c_common_post_options (const char **pfilename)
if (flag_abi_version == 0) if (flag_abi_version == 0)
flag_abi_version = 10; flag_abi_version = 10;
/* 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);
if (cxx_dialect >= cxx11) if (cxx_dialect >= cxx11)
{ {
/* If we're allowing C++0x constructs, don't warn about C++98 /* If we're allowing C++0x constructs, don't warn about C++98
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment