From patchwork Tue May 14 21:17:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1099728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-500681-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="BnGkgwk3"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453VsN4ZyVz9sNw for ; Wed, 15 May 2019 07:18:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=KZdEwSuLub00XpjUSTsdlAeOfEyFCZmB3YwBdwLJ571gCsShq5 nqb+WKjkdDp8nGP7r7qxVSqOnjMubDlTasN/2/0osxdWoMr3na2EnczL1e5S5HzH YogXKZJYid2IAZWq/vH50mXOdeVAog7WIIarW9eNtusQjxGAdDdtcmR2k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=vBQ4KPNEsa/8+RLlVQXI/b8R++o=; b=BnGkgwk3LRMgQ6YsPYNu 5jLWJXpNyTKah4+SvRektOIZd7O5rFoag9JOEhTyTIFcWn69faHmisqZ3wKwACmF XABaI9rrD0lUQLqOSnAjUVErxOlspS39xzIRd6O191QoIOtRJDMiji/ASxWpOQDN xbps3YfFnyGxZ2beLjPNxmc= Received: (qmail 100809 invoked by alias); 14 May 2019 21:18:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 100574 invoked by uid 89); 14 May 2019 21:18:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 May 2019 21:18:03 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0109AC0578F2 for ; Tue, 14 May 2019 21:18:02 +0000 (UTC) Received: from redhat.com (unknown [10.20.4.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C82F1001DE1; Tue, 14 May 2019 21:18:01 +0000 (UTC) Date: Tue, 14 May 2019 17:17:59 -0400 From: Marek Polacek To: GCC Patches Cc: Jason Merrill Subject: C++ PATCH to add test for c++/68918 Message-ID: <20190514211759.GH18891@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) We used to print errors, but since r236221 this compiles fine. clang++ also compiles it without errors. Tested on x86_64-linux, applying to trunk. 2019-05-14 Marek Polacek PR c++/68918 * g++.dg/cpp0x/decltype71.C: New test. diff --git gcc/testsuite/g++.dg/cpp0x/decltype71.C gcc/testsuite/g++.dg/cpp0x/decltype71.C new file mode 100644 index 00000000000..24c3abfba49 --- /dev/null +++ gcc/testsuite/g++.dg/cpp0x/decltype71.C @@ -0,0 +1,25 @@ +// PR c++/68918 +// { dg-do compile { target c++11 } } + +struct foo { + static void a() {} + + auto b() const -> decltype( this->a() ) + {} + + template + auto c() -> decltype( this->a() ) + {} + + template + auto d() const -> decltype( a() ) + {} + + template + auto e() const -> decltype( this->a() ) + {} +}; + +int main() +{ +}