From aa9f4b4c73b8ed63936ba1d932605fafff70cc41 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 14 Sep 2015 10:40:51 +0000 Subject: [PATCH] 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 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-opts.c | 8 ++++---- 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,3 +1,8 @@ +2015-09-14 Marek Polacek + + * c-opts.c (c_common_post_options): Set C++ standard earlier, before + setting various warnings. + 2015-09-14 Marek Polacek * c-common.c (warn_for_sign_compare): Cast to unsigned when shifting 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 -- 2.30.2