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: 1754953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=MGJ0UFT2; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PXshx4nNmz1yWm for ; Fri, 10 Mar 2023 14:58:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FE57385B51D for ; Fri, 10 Mar 2023 03:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FE57385B51D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678420686; bh=tB042FcqFCZvqxkWFiXrRnbcb8FSTnKf4mT6QE8yN+g=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MGJ0UFT2o1ZeJ8YZCBqPc7IclWTozRIQ39r0PR7sarcG2QiRRmsvBGhVvkoQO9scd Dyg8aANs0RBtyfo3J4nSGTTJ14eD4N3U3SrZyGiBXQCKng3wWEWDWagRX/3AknbPo8 KRXD/YMRc9s9EgH0fP53CYOVaM71GcWrQGBqTiuk= 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-Google-Smtp-Source: AK7set+v+3tqjisTRMeNqE8Nw15QFAoEdQWHurkN/zUnzveyDcJhlMGTmxa7IFHgsWVpypkcdz0OqA== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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" }