From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B55723858C50 for ; Mon, 15 May 2023 15:24:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B55723858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684164299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=szyT+qwN0Pze6FCc5BeheYpIkbXtucegY8wAhUtYW60=; b=DSOvMLYm2VMGh95+tHEdC7XQ/14mGMGH4HkQQPwZyXVg7sin68e/RtHcYiO7UmB+wz6LKS nJepvMgz1GvEzECtVOe1qfan+hwZ/DmXRFg99Ekjqv74P7+CG2t3Z1KQG3zYJl6Lf/R/2B D941wJXpTy5HNy47EPYBZGdtJhWL6t0= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-296-_hYofRLePBabDHU0mHqIMA-1; Mon, 15 May 2023 11:24:58 -0400 X-MC-Unique: _hYofRLePBabDHU0mHqIMA-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-3f38fe55146so54979791cf.3 for ; Mon, 15 May 2023 08:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684164297; x=1686756297; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=szyT+qwN0Pze6FCc5BeheYpIkbXtucegY8wAhUtYW60=; b=FMZL6SNPAmD4Be+wwAOX5m8LsVyuZDnUhpQufcCIx+nUnmKf90+FJngFs1Q9mVCR1c whN5u6dLbzBHygEm65HsPQgAhthXbdWOUXUeVLzc1A/+MM+jsUT4R0iuW6Tu17j7GW+c Nd7VmFKAgUseu2ZuYgOgfbzKeHWrNtLwmJX2E3iPPXIuRE1Evi5UfbfFauRitGG7IFgh DbOeJ7wYedRmSwvPtMf/geCV6NKzDuftRdBwPY8SL1JSw4L41k3J9sj7HUYTLNmcQ1+u jX9Hj8Bby1Ol8aB5zj7X6YfOZlSF3wm61pj9xsE/ZC4Fpm1qoaIZS02TPZCqDMBo36Qo 7RjA== X-Gm-Message-State: AC+VfDwW6JIygL+hnxevoTFYm2WcZQUp6lR7jjH+A9ZEtDyI3B02GNAl SLwBxFlFJyt+ZzI8jrvbLIwavegXTfrnDswIn9vGTr//RrcmvAs97gPGJiF7K2gTZAkUnDAAydV gUSkDDxmmFXnALW6sL+bYDFTM2KpFunuN3I+o9R9GdihnVLLIDTX2SocYbwWfGPjyJKl3apkyXt U= X-Received: by 2002:a05:622a:184:b0:3ef:64d9:f0ac with SMTP id s4-20020a05622a018400b003ef64d9f0acmr54804184qtw.14.1684164297580; Mon, 15 May 2023 08:24:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VVvVcIhC0lreYdHccuJjaaA84fxLYMIf/VVG4A8zBHzbiKzL1bW++MtzFfjPnGVBVwkeiog== X-Received: by 2002:a05:622a:184:b0:3ef:64d9:f0ac with SMTP id s4-20020a05622a018400b003ef64d9f0acmr54804148qtw.14.1684164297240; Mon, 15 May 2023 08:24:57 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id ca17-20020a05622a1f1100b003f383cdcf47sm5410703qtb.61.2023.05.15.08.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 08:24:56 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [PATCH] c++: add feature-test macro for auto(x) Date: Mon, 15 May 2023 11:24:55 -0400 Message-ID: <20230515152455.2549476-1-ppalka@redhat.com> X-Mailer: git-send-email 2.40.1.552.g91428f078b MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This adds the feature-test macro for PR0849R8, as per https://github.com/cplusplus/CWG/issues/281. Tested on x86_64-pc-linux-gnu, does this look OK for trunk/13? gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Predefine __cpp_auto_cast for C++23. gcc/testsuite/ChangeLog: * g++.dg/cpp23/feat-cxx2b.C: Test __cpp_auto_cast. --- gcc/c-family/c-cppbuiltin.cc | 1 + gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 98f5aef2af9..5d64625fcd7 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -1074,6 +1074,7 @@ c_cpp_builtins (cpp_reader *pfile) /* Set feature test macros for C++23. */ cpp_define (pfile, "__cpp_size_t_suffix=202011L"); cpp_define (pfile, "__cpp_if_consteval=202106L"); + cpp_define (pfile, "__cpp_auto_cast=202110L"); cpp_define (pfile, "__cpp_constexpr=202211L"); cpp_define (pfile, "__cpp_multidimensional_subscript=202211L"); cpp_define (pfile, "__cpp_named_character_escapes=202207L"); diff --git a/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C b/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C index 6f4f6bcaad0..9e29b01adc1 100644 --- a/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C +++ b/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C @@ -578,6 +578,12 @@ # error "__cpp_implicit_move != 202207" #endif +#ifndef __cpp_auto_cast +# error "__cpp_auto_cast" +#elif __cpp_auto_cast != 202110 +# error "__cpp_auto_cast != 202110" +#endif + // C++23 attributes: #ifdef __has_cpp_attribute -- 2.40.1.552.g91428f078b