From patchwork Fri Mar 10 03:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 67199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp671180wrd; Thu, 9 Mar 2023 19:58:35 -0800 (PST) X-Google-Smtp-Source: AK7set+nXWK1QE+Hzy0os7fYrpPAEXCiyQnZr8DNcIRE8Di0xI9a6mwpIuPQ9vNRKxRwcWCueTLC X-Received: by 2002:a17:906:40b:b0:8b2:7150:dcff with SMTP id d11-20020a170906040b00b008b27150dcffmr23302648eja.23.1678420715288; Thu, 09 Mar 2023 19:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678420715; cv=none; d=google.com; s=arc-20160816; b=jyYv5XeUVRXsu7eC3D8lVBGQSKMvJGTo/xvtjiLKUll1ywwEnp5cIKDyrUqrPFgS2M j2wWBsGBvON8B6P1iBAUAkPRXhZ2cJVQAwKAUTnhJPBomAZJhK9YbCilSojmSI8sPsQ7 VI5IJKY1l0T9TVgvFq8arLPQFQOSeyYY21zgxjoqrkcptOW27CofVx6KqZfDlY6fggA7 mSDgpL2XfOcjgz9yJvZCX8XidYCNtuAVQSAMgG2hXBIDkQfvV2tqpx4j2ZrU5HZ1lstv PNfgLTSvYhV/IWhFB6vIMb4nYqiyfGohph3zI7y+2WYGGO5UZbKl4+Fhqv6But0PNd9R 4enA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=tB042FcqFCZvqxkWFiXrRnbcb8FSTnKf4mT6QE8yN+g=; b=0cPpoxYc4HI4P90ijXetmG9MaEBeuA/mE3zFI/bXM8Y0N5+IcaDvI/EE44YKB6aZKP N7mWWuRhXA8n2axFP9atv01KR2N42C5W7ok1DgsDbiriK7oL/mBCiM2P9o5nKdK3nDMd +eg8vlj2kDorfJ4s5n3kydOcXv0+vNmFicf10eFWZVKVjXyqacoxAqpBNOAboQ1HBC/Z J9faKtOFeHb50w4WH1kBxJKLzqIrcr62m+coUZXC+OVfHasdC68UdqtQBLqk7O22s0rR WcOtnr2StvJzsTXy+RfuUB2930MLGL4b6N9bXlKoNy+Fyo9b6nkRXup0nDKdBXv2gq3+ D+cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FQ8Fl5zv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id si4-20020a170906cec400b008b17fe8a06bsi957415ejb.70.2023.03.09.19.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 19:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FQ8Fl5zv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 325BB3858C78 for ; Fri, 10 Mar 2023 03:58:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 325BB3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678420711; bh=tB042FcqFCZvqxkWFiXrRnbcb8FSTnKf4mT6QE8yN+g=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=FQ8Fl5zvxwtsYi8orxojtfS2ZOOKqxnfgD2o90kGZ5+0r2cgPs7YPZw/lvS+6Bt9N y0QYv8Cwlmo8p7aeEfAyMauXrCS96zosYXVtwWHQRuI04WyJQb8Gtj1eON2+HSfkV/ tSi6wcjZtSO2CgmLWxm4G1ed00133idnV4/sbiiI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 119E13858C5E for ; Fri, 10 Mar 2023 03:57:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 119E13858C5E Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-Yf8bMz1xPX6HE7Kh0jdWkg-1; Thu, 09 Mar 2023 22:57:44 -0500 X-MC-Unique: Yf8bMz1xPX6HE7Kh0jdWkg-1 Received: by mail-qk1-f200.google.com with SMTP id s21-20020a05620a0bd500b0074234f33f24so2417079qki.3 for ; Thu, 09 Mar 2023 19:57:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678420661; 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=tB042FcqFCZvqxkWFiXrRnbcb8FSTnKf4mT6QE8yN+g=; b=kwkte0lHlYTf+AvdJDgcJs332p3dae8AGYd3iUeJgfKTcEEyvFh/xWElfuwT3bUhCP LM/zTK3ED6c43LJYAIUcX3OruyVNaRAg13w37Llaza33AFKxdI6O++u65qLINEmleUiK SGF5xNXlZ0jYeoH6dXBAqtfVArxZbnEFgWY1SX32Cdzoyrn6gF+gPxcKrk/jhsxCGyv6 13gR+LZytihizMjXzmrn/SVrmFbVO2R7J34O8JeihdOLZFBmK2rUdu2Rx7en6UWtQwzU v8as808PDiRbj0Iy4JtIfUwcOOxPUNiOvrsn1oWFyXdGvkHQxENdbB2Bkxgs9bX6CqEq zjfA== X-Gm-Message-State: AO0yUKXodPaLfC0ev5txhShMnxus13qk6ZfNV87eZA/9Y2CwZM2DvHj6 v+D0aSEIvLOBMdW6/Qy5jj77OqRQROzC+4Ly1QGKAJ8Vw+4mUbn9641A7zMHzWSf5a/0ZJlkvD/ xnMT2r05Lhm7WAM2hTFBrEckYIN4pkT8zpKzk3Y5t4R4R0v9LEoxglACMR2sFGEw/OF9wKAms1A == X-Received: by 2002:ac8:59d6:0:b0:3bf:d310:cc93 with SMTP id f22-20020ac859d6000000b003bfd310cc93mr19702787qtf.35.1678420660907; Thu, 09 Mar 2023 19:57:40 -0800 (PST) X-Received: by 2002:ac8:59d6:0:b0:3bf:d310:cc93 with SMTP id f22-20020ac859d6000000b003bfd310cc93mr19702765qtf.35.1678420660524; Thu, 09 Mar 2023 19:57:40 -0800 (PST) Received: from jason.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id c26-20020a05620a0cfa00b0073b587194d0sm534220qkj.104.2023.03.09.19.57.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 19:57:39 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: signed __int128_t [PR108099] Date: Thu, 9 Mar 2023 22:57:36 -0500 Message-Id: <20230310035736.2418695-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.6 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759951680191602739?= X-GMAIL-MSGID: =?utf-8?q?1759951680191602739?= Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The code for handling signed + typedef was breaking on __int128_t, because it isn't a proper typedef: it doesn't have DECL_ORIGINAL_TYPE. PR c++/108099 gcc/cp/ChangeLog: * decl.cc (grokdeclarator): Handle non-typedef typedef_decl. gcc/testsuite/ChangeLog: * g++.dg/ext/int128-7.C: New test. --- gcc/cp/decl.cc | 11 ++++++++--- gcc/testsuite/g++.dg/ext/int128-7.C | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ext/int128-7.C base-commit: 68c5d92a1390ecccb61d3600a95eeff6caf7ccdf diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 30c7470974d..b1603859644 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -12440,10 +12440,15 @@ grokdeclarator (const cp_declarator *declarator, { if (typedef_decl) { - pedwarn (loc, OPT_Wpedantic, "%qs specified with %qT", - key, type); + pedwarn (loc, OPT_Wpedantic, "%qs specified with %qD", + key, typedef_decl); ok = !flag_pedantic_errors; - type = DECL_ORIGINAL_TYPE (typedef_decl); + if (is_typedef_decl (typedef_decl)) + type = DECL_ORIGINAL_TYPE (typedef_decl); + else + /* PR108099: __int128_t comes from c_common_nodes_and_builtins, + and is not built as a typedef. */ + type = TREE_TYPE (typedef_decl); typedef_decl = NULL_TREE; } else if (declspecs->decltype_p) diff --git a/gcc/testsuite/g++.dg/ext/int128-7.C b/gcc/testsuite/g++.dg/ext/int128-7.C new file mode 100644 index 00000000000..bf5e8c40a4b --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/int128-7.C @@ -0,0 +1,4 @@ +// PR c++/108099 +// { dg-do compile { target { c++11 && int128 } } } + +using i128 = signed __int128_t; // { dg-error "specified with" }