From patchwork Fri Dec 12 03:47:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 420358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EC8AF1400A0 for ; Fri, 12 Dec 2014 14:47:24 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=dV94jURxHlOPIdzIHhDSeRqfM8I5UGzHWUiPBlBerCVqai JwIxlbfrfnj+QHrKkIxXwj80O2Brn+8TMn9klYvtjmLa4PMmr/KRzvnWapxDAMSh hT1InCjW5fdiW05fXYOIs1jn+//v9qjDmNxSE8SvmBdMxSj9NOl/owhQVOzqY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=JLOed1Kmlyryzlrg5QT183fbU2g=; b=P05VzC5QZh+ob3dAIcy3 v9CByRHBHt/qe5NF0eZU43pfh/C2z9anFm82A4dJOdwQlzcPlPGZogD0IrB4AHXr QoZyJMJcg3bex3N4MDvaDsjprZpUW3nY7unRhViIx+qpLxd7Yad1HMQUnAJL4fcA kc9ueqgSK4vVoPrdyQHxOgc= Received: (qmail 30042 invoked by alias); 12 Dec 2014 03:47:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30028 invoked by uid 89); 12 Dec 2014 03:47:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD, UNWANTED_LANGUAGE_BODY autolearn=ham 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, 12 Dec 2014 03:47:14 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBC3lCod022960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 11 Dec 2014 22:47:13 -0500 Received: from [10.10.116.25] ([10.10.116.25]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBC3lCiU008698 for ; Thu, 11 Dec 2014 22:47:12 -0500 Message-ID: <548A6540.7070305@redhat.com> Date: Thu, 11 Dec 2014 22:47:12 -0500 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: gcc-patches List Subject: c-family PATCH to update __cpp_constexpr macro for C++14 constexpr support A bit I forgot in the earlier C++14 constexpr work. Tested x86_64-pc-linux-gnu, applying to trunk. commit 0b9dbcebc4d3bf5e9281889f34d189fb7c42dde3 Author: Jason Merrill Date: Thu Dec 11 22:19:36 2014 -0500 * c-cppbuiltin.c (c_cpp_builtins): Enable C++14 __cpp_constexpr. diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 54d3acd..2dfecb6 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -845,7 +845,8 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__cpp_unicode_literals=200710"); cpp_define (pfile, "__cpp_user_defined_literals=200809"); cpp_define (pfile, "__cpp_lambdas=200907"); - cpp_define (pfile, "__cpp_constexpr=200704"); + if (cxx_dialect == cxx11) + cpp_define (pfile, "__cpp_constexpr=200704"); cpp_define (pfile, "__cpp_range_based_for=200907"); cpp_define (pfile, "__cpp_static_assert=200410"); cpp_define (pfile, "__cpp_decltype=200707"); @@ -865,8 +866,7 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__cpp_return_type_deduction=201304"); cpp_define (pfile, "__cpp_init_captures=201304"); cpp_define (pfile, "__cpp_generic_lambdas=201304"); - //cpp_undef (pfile, "__cpp_constexpr"); - //cpp_define (pfile, "__cpp_constexpr=201304"); + cpp_define (pfile, "__cpp_constexpr=201304"); cpp_define (pfile, "__cpp_decltype_auto=201304"); cpp_define (pfile, "__cpp_aggregate_nsdmi=201304"); cpp_define (pfile, "__cpp_variable_templates=201304"); diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C index d271752..36e1135 100644 --- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C +++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C @@ -47,12 +47,6 @@ # error "__cpp_lambdas != 200907" #endif -#ifndef __cpp_constexpr -# error "__cpp_constexpr" -#elif __cpp_constexpr != 200704 -# error "__cpp_constexpr != 200704" -#endif - #ifndef __cpp_range_based_for # error "__cpp_range_based_for" #elif __cpp_range_based_for != 200907 @@ -145,11 +139,10 @@ # error "__cpp_generic_lambdas != 201304" #endif -// TODO: Change 200704 to 201304 when C++14 constexpr goes in. #ifndef __cpp_constexpr # error "__cpp_constexpr" -#elif __cpp_constexpr != 200704 -# error "__cpp_constexpr != 200704" +#elif __cpp_constexpr != 201304 +# error "__cpp_constexpr != 201304" #endif #ifndef __cpp_decltype_auto