From patchwork Fri Feb 10 21:00:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 726742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vKnQz67b4z9s5g for ; Sat, 11 Feb 2017 08:00:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="B8OokMdM"; dkim-atps=neutral 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:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=MulZmbdCfr0+rB8Ix7ps71vqnBfkVMkNg429o1+ct7z VVSTysrrAfJg3RVO/3oNAPXDa6Ga4/FNGph/VGtJlDwQEp8aypF2MuCWf3UMqExm xW9qzm2k6P7EyYVa+Ogn/HgzuOViVkEa3Aox5qYf73RksAT77IoKoAqEOrNGb3gI = 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:subject:message-id:reply-to:mime-version:content-type; s=default; bh=n3+4awdnLngVY+O5TwFUGlq0a+k=; b=B8OokMdM9GVfEjpEZ l9Fl0wa2wcYwtrhOu4iTC1dpQVJ1hI/W0LEeaKD8rj1A3OLPARwbw5IEaHbxWbPJ UT1lnZikRoHjUDzzKos1zVfRji8FDFnHYy0c9NiEdxRjYHXs++igZXAxRE9pJQIx /cd2AvYxGxKdRazhi7J5A5v7Gk= Received: (qmail 19154 invoked by alias); 10 Feb 2017 21:00:31 -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 19087 invoked by uid 89); 10 Feb 2017 21:00:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=1, 24 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; Fri, 10 Feb 2017 21:00:20 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB66281231 for ; Fri, 10 Feb 2017 21:00:20 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-76.ams2.redhat.com [10.36.116.76]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1AL0Jve018006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 10 Feb 2017 16:00:20 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v1AL0Gdp005971 for ; Fri, 10 Feb 2017 22:00:17 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v1AL0FbW005970 for gcc-patches@gcc.gnu.org; Fri, 10 Feb 2017 22:00:15 +0100 Date: Fri, 10 Feb 2017 22:00:15 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Add a testcase (PR c++/79457) Message-ID: <20170210210015.GW1849@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! This PR got fixed in r244833, but as the testcase isn't a 7.x regression, but existed for years, I think it is worth to check in this testcase too. Tested on x86_64-linux, committed to trunk as obvious. 2017-02-10 Jakub Jelinek PR c++/79457 * g++.dg/cpp0x/pr79457.C: New test. Jakub --- gcc/testsuite/g++.dg/cpp0x/pr79457.C.jj 2017-02-10 21:55:22.606388165 +0100 +++ gcc/testsuite/g++.dg/cpp0x/pr79457.C 2017-02-10 21:50:54.000000000 +0100 @@ -0,0 +1,24 @@ +// PR c++/79457 +// { dg-do compile { target c++11 } } + +template +class Foo +{ +private: + T& goo; + template + using S = decltype (goo[R ()]); + +public: + Foo (T& goo) : goo {goo} {} + + template + S boo () {} +}; + +int +main () +{ + int bar[] = {1, 2, 3}; + Foo foo {bar}; +}