From patchwork Wed Feb 13 16:38:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1041422 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-496019-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="o6Az46Yk"; 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 4404w40g9nz9s7h for ; Thu, 14 Feb 2019 03:38:27 +1100 (AEDT) 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:mime-version:content-type; q=dns; s= default; b=DU5o9mPIWJRGIwHbVtaRbHzPhPcifxxMNBd+uekGxwyQzoHd8puJG 9aa9ecjfhGbsNKN+yfOXFEv2yX/0rX9yvb+InMOczroDNnisak4pE+vwFuG3TWdj w+STgehYCh1risQ5LyF5s8dSgw4nm8yQnCZQHcGoAiNiAvyK366XSU= 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:mime-version:content-type; s= default; bh=Q5enwMQeBjuVccX1AhnMajGEJyU=; b=o6Az46Yk/bLuM+Zecmt5 KlANCXxgdyxcCsmqiMeOwSwjWEMYodZBpZzuekxjJifEx7tzeaCVXr0PsS5gnd+/ WvGcpN//DA2UzU0cm2kO66xSzFOuJ9KqX176u2CrHuvBGZLjI77KsPZ67GF9UQcF avM16uEm+zByCl1/RMhZkdA= Received: (qmail 127912 invoked by alias); 13 Feb 2019 16:38:20 -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 127904 invoked by uid 89); 13 Feb 2019 16:38:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.2 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; Wed, 13 Feb 2019 16:38:18 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B65AF66962 for ; Wed, 13 Feb 2019 16:38:17 +0000 (UTC) Received: from redhat.com (ovpn-125-179.rdu2.redhat.com [10.10.125.179]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66DA6600C0 for ; Wed, 13 Feb 2019 16:38:17 +0000 (UTC) Date: Wed, 13 Feb 2019 11:38:11 -0500 From: Marek Polacek To: GCC Patches Subject: C++ PATCH to add test for c++/77304 Message-ID: <20190213163811.GU3884@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Tested x86_64-linux, checking in as obvious. 2019-02-13 Marek Polacek PR c++/77304 * g++.dg/cpp2a/nontype-class13.C: New test. diff --git gcc/testsuite/g++.dg/cpp2a/nontype-class13.C gcc/testsuite/g++.dg/cpp2a/nontype-class13.C new file mode 100644 index 00000000000..14c601ba040 --- /dev/null +++ gcc/testsuite/g++.dg/cpp2a/nontype-class13.C @@ -0,0 +1,21 @@ +// PR c++/77304 +// { dg-do compile { target c++2a } } + +struct S {}; + +template < typename T > struct A +{ + template < S > void f () {} + + static void * g () + { + return (void *) f < a >; // { dg-error "invalid" } + } + + static S a; +}; + +void * f () +{ + return A < int >::g (); +}