summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-14 10:40:51 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-14 10:40:51 +0000
commite4cc057fa4b98d67f58588232142afec3497ff08 (patch)
treee05d80ac97c881664e14469e1c78fd6ee22b2201
parent85f5e2ee5bdb17494e93b808d40eddda858a0a2d (diff)
downloadgcc-e4cc057fa4b98d67f58588232142afec3497ff08.tar.gz
* c-opts.c (c_common_post_options): Set C++ standard earlier, before
setting various warnings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227744 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-opts.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 8f8de188005..888c28f505d 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,10 @@
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
a negative value.
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 3239a853546..f358b62a908 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -800,6 +800,10 @@ 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. */
@@ -887,10 +891,6 @@ c_common_post_options (const char **pfilename)
if (flag_abi_version == 0)
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 we're allowing C++0x constructs, don't warn about C++98