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.129.124]) by sourceware.org (Postfix) with ESMTPS id 940F53858C33 for ; Mon, 14 Aug 2023 17:33:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 940F53858C33 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=1692034397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L+XFdca1lDp51SkCyJFJl57UqX36syE+Qole+MQSMAo=; b=L+JIwFBt4nR+crTZH7UoHgUiQqKzdHF3RhSKoVr1BkhOn5+MLeFhdWmQ8DOo7L/cJ6iwyt y1CybpZ8UgtneEyh/t2FraJmt7XLmuyBDAV1+Bni0MdnVAeFp7eVLptjVE2XvBlCow4uef Qn/FFhKXDijDSEL1+6nxCLaIKPSrrN0= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-9-mBoYrijONI-2rUYGwaGx6w-1; Mon, 14 Aug 2023 13:33:15 -0400 X-MC-Unique: mBoYrijONI-2rUYGwaGx6w-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-641aa322d8aso36989846d6.3 for ; Mon, 14 Aug 2023 10:33:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692034395; x=1692639195; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L+XFdca1lDp51SkCyJFJl57UqX36syE+Qole+MQSMAo=; b=MrQRy/30uk0pB/javQSePELH023nbfo4hCJRoIjfxw57EaHbVCFjeNM1Vke5J7xAhR n3VrQAWgVTn+hcdgUnRwD4fQwvq22JZ7Sp6aDWyFS+/PQ+xO3kK+7DODvWNIvjl2KzU7 7RXsp7awaKY31ETLNOGMQI/ZoNVOALmnWHl0gVpSmdIyQS69Kjwd8jILZvUfsxlCpWA1 b/QECLpCi7lg9ZCr4+1GwEwgruOdE8kdxHxvrbmeRW9qwoIXymDZxp5sw38vsCdA+Kb/ qr+wJwP/EUUOnbQVocVM+qbQfGE6b+CSobk7OU3z1XKo/wb92sphZ2shwqKY9vSHmAzf OFVA== X-Gm-Message-State: AOJu0YwxIkmT2Y5w+3jYK+t6iVPpB+d+dxKAsYZjjVomEk05Azul+I4Y e8ypFSelK0qDZIdx1vAZ/eJSQY21EkwsVFMxyEoRSmYEaWhexcQC3SMooXxgdFymckftOWeiA4A 6+7WLM/Yh3StJgovM/tIaMffyzD/0YYQdF/57tciXMhWnoAY5r/gVwQJCVUYG61N+NNyNTO8RgQ == X-Received: by 2002:a0c:b251:0:b0:640:5beb:d89d with SMTP id k17-20020a0cb251000000b006405bebd89dmr10571649qve.40.1692034395120; Mon, 14 Aug 2023 10:33:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPrEMtUu/VZsMuIpYUqnPmz3KGygmYHgNlX22aNJJ0WxdpNBD6y9EhJVvI0uJKBx8vPcZE1w== X-Received: by 2002:a0c:b251:0:b0:640:5beb:d89d with SMTP id k17-20020a0cb251000000b006405bebd89dmr10571613qve.40.1692034394569; Mon, 14 Aug 2023 10:33:14 -0700 (PDT) Received: from jason.lan (121.56.59.66.in-addr.crocker.net. [66.59.56.121]) by smtp.gmail.com with ESMTPSA id t27-20020a05620a035b00b007678973eaa1sm3176398qkm.127.2023.08.14.10.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 10:33:13 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: -fconcepts and __cpp_concepts Date: Mon, 14 Aug 2023 13:33:12 -0400 Message-Id: <20230814173312.14980-1-jason@redhat.com> X-Mailer: git-send-email 2.39.3 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=-12.8 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP 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: Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Since -fconcepts no longer implies -fconcepts-ts, we shouldn't advertise TS support with __cpp_concepts=201507L. Also fix one case where -std=c++14 -fconcepts wasn't working (as found by range-v3 calendar). Fixing other cases is not a priority, probably better to reject that flag combination if there are further issues. gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Adjust __cpp_concepts. gcc/cp/ChangeLog: * parser.cc (cp_parser_simple_type_specifier): Handle -std=c++14 -fconcepts. --- gcc/c-family/c-cppbuiltin.cc | 2 +- gcc/cp/parser.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 6bd4c1261a7..f2b12fd63db 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -1089,7 +1089,7 @@ c_cpp_builtins (cpp_reader *pfile) } if (flag_concepts) { - if (cxx_dialect >= cxx20) + if (cxx_dialect >= cxx20 || !flag_concepts_ts) cpp_define (pfile, "__cpp_concepts=202002L"); else cpp_define (pfile, "__cpp_concepts=201507L"); diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 2d27376d988..7f646704d3f 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -20017,12 +20017,13 @@ cp_parser_simple_type_specifier (cp_parser* parser, /* Otherwise, look for a type-name. */ if (!type) { - if (cxx_dialect >= cxx17) + if (cxx_dialect >= cxx17 || flag_concepts) cp_parser_parse_tentatively (parser); type = cp_parser_type_name (parser, (qualified_p && typename_p)); - if (cxx_dialect >= cxx17 && !cp_parser_parse_definitely (parser)) + if ((cxx_dialect >= cxx17 || flag_concepts) + && !cp_parser_parse_definitely (parser)) type = NULL_TREE; } base-commit: 2d2b05f0691799f03062bf5c436462f14cad3e7c -- 2.39.3