From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102469 invoked by alias); 4 Sep 2015 11:04:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102458 invoked by uid 89); 4 Sep 2015 11:04:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 04 Sep 2015 11:04:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 46893AB105 for ; Fri, 4 Sep 2015 11:04:24 +0000 (UTC) Received: from redhat.com (ovpn-204-115.brq.redhat.com [10.40.204.115]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84B4Kk3014769 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Fri, 4 Sep 2015 07:04:23 -0400 Date: Fri, 04 Sep 2015 11:10:00 -0000 From: Marek Polacek To: GCC Patches , Jason Merrill Subject: [C++ PATCH] Set C++ standard earlier Message-ID: <20150904110419.GC2813@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00336.txt.bz2 I noticed that -Wshift-overflow isn't on by default even though now we're defaulting to C++14. The reason is that at the time we set warn_shift_overflow the cxx_dialect is still cxx_unset. So let's set the default C++ standard earlier in that function, before be enable/disable the warnings. (A two other patches are prerequisite before this may go in.) Bootstrapped/regtested on x86_64-linux, ok for trunk? 2015-09-04 Marek Polacek * c-opts.c (c_common_post_options): Set C++ standard earlier, before setting various warnings. diff --git gcc/c-family/c-opts.c gcc/c-family/c-opts.c index 3239a85..f358b62 100644 --- gcc/c-family/c-opts.c +++ 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 Marek