public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10694: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared
@ 2003-05-09  1:16 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-05-09  1:16 UTC (permalink / raw)
  To: gcc-gnats


>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 <class T> struct Y;
    
template <class S> class X {
    template <class T> friend void Y<T>::member();
};
    
template <class T> struct Y {
    void member() {
      X<int>();
    }
};
    
template class Y<int>;
-------------------------------
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<int>':
x.cc:9:   instantiated from `void Y<T>::member() [with T = int]'
x.cc:13:   instantiated from here
x.cc:4: error: prototype for `template<class T> void Y::member()' does not
   match any in class `Y<T>'
x.cc:8: error: candidate is: void Y<T>::member()


g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc -W -Wall
x.cc: In instantiation of `X<int>':
x.cc:9:   instantiated from `void Y<T>::member() [with T = int]'
x.cc:13:   instantiated from here
x.cc:4: error: prototype for `template<class T> void Y::member()' does not
   match any in class `Y<T>'
x.cc:8: error: candidate is: void Y<T>::member()
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/10694: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared
@ 2003-05-11 11:16 Steven Bosscher
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Bosscher @ 2003-05-11 11:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10694; it has been noted by GNATS.

From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: bangerth@dealii.org, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
	nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: c++/10694: [3.3/3.4 regression] Befriending a function in a class
 that is only forward-declared
Date: Sun, 11 May 2003 13:10:09 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10694
 
 : Search converges between 2003-03-10-trunk (#149) and 2003-03-11-trunk 
 (#150).
 
 Line-numbered input is:
 ========================================
      1  template <class T> struct Y;
      2    
      3  template <class S> class X {
      4      template <class T> friend void Y<T>::member();
      5  };
      6    
      7  template <class T> struct Y {
      8      void member() {
      9        X<int>();
     10      }
     11  };
     12    
     13  template class Y<int>;
     14 
 
 ========================================
 
 
 Diagnostic output follows, from the last compiler tested:
 input: In instantiation of `X<int>':
 input:9:   instantiated from `void Y<T>::member() [with T = int]'
 input:13:   instantiated from here
 input:4: error: prototype for `template<class T> void Y::member()' does not
    match any in class `Y<T>'
 input:8: error: candidate is: void Y<T>::member()
 
 Compiler output follows, from the last compiler tested:
         .file   "input"
         .ident  "GCC: (GNU) 3.4 20030311 (experimental)"
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/10694: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared
@ 2003-05-11 10:33 lerdsuwa
  0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2003-05-11 10:33 UTC (permalink / raw)
  To: bangerth, gcc-bugs, gcc-prs, nobody

Synopsis: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared

State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sun May 11 10:33:13 2003
State-Changed-Why:
    Confirmed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10694


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-11 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09  1:16 c++/10694: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared bangerth
2003-05-11 10:33 lerdsuwa
2003-05-11 11:16 Steven Bosscher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).