From patchwork Wed Feb 23 17:48:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1596837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=BpDrCEAp; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K3k781DKlz9sFx for ; Thu, 24 Feb 2022 04:49:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AFC4C3858425 for ; Wed, 23 Feb 2022 17:49:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFC4C3858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1645638545; bh=gG+1jAlNdqDX6GsXSVVfrnXOnulbGSIoudGUt8T8+SI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=BpDrCEApzL+jr5XFHDIN4OETrNYCnSg56QZyXtBeVBQADRvxzYtEEl1dSm5xbK2RE ePmlina/O2yHK6qysT09hD1uZE8ARQviglPuv0/ESpamh4J+a604JaZYzz1Jg2XECn nqEgw9sgpEfVo4mZF22mUPDzXc4ShRb3ay9D8ikc= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 2E536385841A for ; Wed, 23 Feb 2022 17:48:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E536385841A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-Jnhxqh7jPkukuYjxyfNgAg-1; Wed, 23 Feb 2022 12:48:39 -0500 X-MC-Unique: Jnhxqh7jPkukuYjxyfNgAg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3906804B65 for ; Wed, 23 Feb 2022 17:48:38 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.34.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id 823D2865B5 for ; Wed, 23 Feb 2022 17:48:38 +0000 (UTC) To: GCC Patches Subject: [pushed] c++: Add new test [PR79493] Date: Wed, 23 Feb 2022 12:48:35 -0500 Message-Id: <20220223174835.72122-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Marek Polacek via Gcc-patches From: Marek Polacek Reply-To: Marek Polacek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" A nice side effect of r12-1822 was improving the diagnostic we emit for the following test. Tested x86_64-pc-linux-gnu, applying to trunk. PR c++/79493 gcc/testsuite/ChangeLog: * g++.dg/diagnostic/undeclared1.C: New test. --- gcc/testsuite/g++.dg/diagnostic/undeclared1.C | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 gcc/testsuite/g++.dg/diagnostic/undeclared1.C base-commit: 9675ecf7f9beeee340f93c68cf22280f5975a902 diff --git a/gcc/testsuite/g++.dg/diagnostic/undeclared1.C b/gcc/testsuite/g++.dg/diagnostic/undeclared1.C new file mode 100644 index 00000000000..98c1ecb6581 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/undeclared1.C @@ -0,0 +1,7 @@ +// PR c++/79493 + +namespace A { } +struct B { + void f(A::nonexistent param); // { dg-error ".A::nonexistent. has not been declared" } + void* g(A::nonexistent param); // { dg-error ".A::nonexistent. has not been declared" } +};