From patchwork Mon Apr 16 14:14:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 152864 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]) by ozlabs.org (Postfix) with SMTP id B652EB6FFF for ; Tue, 17 Apr 2012 00:15:25 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1335190527; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=/4VdBQi 1iSXEqFT5YriK93j69Dc=; b=PEFAfgXKPr9fnnwyTWSoa/EDjqbBcKjAqBHIlvN 0O9XDtohR5hBeQnFOkFJ2/a5pxudz+3nW0eecdp1KMe2dYZZ94Urm+KRSUOTMusr pGSdeg8xGBAX+zK/NxagBQ/V72ORA2nSQYX6haQHGSM2yiQAw3J/ukGMaNrWM1Mr nB68= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=gtnL+y5RDFZK2/RCUUtbm2UTZNZD6v3oFqUnrMhLhfOT1gOUJ/TqEVwaZE5oAl aiijBkZ/PabXAPuKaHJgKlt+mVt3X8yclAaR0kMmSMUduZNJsUp9A7Kf9yCNzqEL ljRFYX27MzoWCSUdHZGYpen5fwMYA//KkWbhVs4s+RMiU=; Received: (qmail 24536 invoked by alias); 16 Apr 2012 14:15:19 -0000 Received: (qmail 24526 invoked by uid 22791); 16 Apr 2012 14:15:17 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Apr 2012 14:14:55 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GEEshF001052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Apr 2012 10:14:54 -0400 Received: from [10.3.113.15] ([10.3.113.15]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3GEErur022330 for ; Mon, 16 Apr 2012 10:14:54 -0400 Message-ID: <4F8C295D.5030700@redhat.com> Date: Mon, 16 Apr 2012 10:14:53 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/51148 (missed error on unexpanded pack in friend declaration) 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 Just another place we need to call check_for_bare_parameter_packs. Tested x86_64-pc-linux-gnu, applying to trunk. commit 616afbea9bf859633ade63b6536e5b63be5a19e6 Author: Jason Merrill Date: Mon Apr 16 09:23:41 2012 -0400 PR c++/51148 * friend.c (make_friend_class): Call check_for_bare_parameter_packs. diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index e532a30..87a093a 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -239,6 +239,9 @@ make_friend_class (tree type, tree friend_type, bool complain) friend_type = cv_unqualified (friend_type); + if (check_for_bare_parameter_packs (friend_type)) + return; + if (friend_depth) /* If the TYPE is a template then it makes sense for it to be friends with itself; this means that each instantiation is diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic127.C b/gcc/testsuite/g++.dg/cpp0x/variadic127.C new file mode 100644 index 0000000..2e0d593 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic127.C @@ -0,0 +1,15 @@ +// PR c++/51148 +// { dg-do compile { target c++11 } } + +template +struct S +{}; + +template +struct T +{ + friend class S; // { dg-error "parameter packs not expanded" } +}; + +int main() +{}