aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-09-14 10:40:51 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-09-14 10:40:51 +0000
commitaa9f4b4c73b8ed63936ba1d932605fafff70cc41 (patch)
treee05d80ac97c881664e14469e1c78fd6ee22b2201
parentaa256c4aedce567eff0d5fdf7b2e4067bc9e3c42 (diff)
downloadgcc-aa9f4b4c73b8ed63936ba1d932605fafff70cc41.zip
gcc-aa9f4b4c73b8ed63936ba1d932605fafff70cc41.tar.gz
gcc-aa9f4b4c73b8ed63936ba1d932605fafff70cc41.tar.bz2
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
-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 8f8de18..888c28f 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 3239a85..f358b62 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