From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25569 invoked by alias); 9 May 2003 01:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25517 invoked by uid 71); 9 May 2003 01:16:01 -0000 Resent-Date: 9 May 2003 01:16:01 -0000 Resent-Message-ID: <20030509011601.25516.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, bangerth@dealii.org Received: (qmail 21361 invoked by uid 48); 9 May 2003 01:10:10 -0000 Message-Id: <20030509011010.21360.qmail@sources.redhat.com> Date: Fri, 09 May 2003 01:16:00 -0000 From: bangerth@dealii.org Reply-To: bangerth@dealii.org To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10694: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared X-SW-Source: 2003-05/txt/msg00687.txt.bz2 List-Id: >Number: 10694 >Category: c++ >Synopsis: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri May 09 01:16:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Wolfgang Bangerth >Release: unknown-1.0 >Organization: >Environment: 3.3 and present mainline >Description: Extracted from PR 7818 (but unrelated to the original cause of that PR): This used to work until 3.2.3, but fails in 3.3 and mainline: -------------------------- template struct Y; template class X { template friend void Y::member(); }; template struct Y { void member() { X(); } }; template class Y; ------------------------------- g/x> /home/bangerth/bin/gcc-3.2.3-pre/bin/c++ x.cc -W -Wall -c g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc -W -Wall x.cc: In instantiation of `X': x.cc:9: instantiated from `void Y::member() [with T = int]' x.cc:13: instantiated from here x.cc:4: error: prototype for `template void Y::member()' does not match any in class `Y' x.cc:8: error: candidate is: void Y::member() g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc -W -Wall x.cc: In instantiation of `X': x.cc:9: instantiated from `void Y::member() [with T = int]' x.cc:13: instantiated from here x.cc:4: error: prototype for `template void Y::member()' does not match any in class `Y' x.cc:8: error: candidate is: void Y::member() >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: