From e4cc057fa4b98d67f58588232142afec3497ff08 Mon Sep 17 00:00:00 2001 From: mpolacek Date: Mon, 14 Sep 2015 10:40:51 +0000 Subject: * 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 --- 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 -- cgit v1.2.1