public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
@ 2003-06-03 14:56 ` lerdsuwa@gcc.gnu.org
  2003-06-22  1:06 ` [Bug c++/11030] two-stage name lookup: " pinskia at physics dot uc dot edu
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa@gcc.gnu.org @ 2003-06-03 14:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030


lerdsuwa@gcc.gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2003-05-30 13:01:59         |2003-06-03 14:56:55
               date|                            |





------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/11030] two-stage name lookup: Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
  2003-06-03 14:56 ` [Bug c++/11030] Cannot befriend a template specialization lerdsuwa@gcc.gnu.org
@ 2003-06-22  1:06 ` pinskia at physics dot uc dot edu
  2003-06-22  6:38 ` [Bug c++/11030] " bangerth at dealii dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-06-22  1:06 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Cannot befriend a template  |two-stage name lookup:
                   |specialization              |Cannot befriend a template
                   |                            |specialization


------- Additional Comments From pinskia at physics dot uc dot edu  2003-06-22 01:06 -------
I think this is a gcc does not have `two stage lookup' bug.


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

* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
  2003-06-03 14:56 ` [Bug c++/11030] Cannot befriend a template specialization lerdsuwa@gcc.gnu.org
  2003-06-22  1:06 ` [Bug c++/11030] two-stage name lookup: " pinskia at physics dot uc dot edu
@ 2003-06-22  6:38 ` bangerth at dealii dot org
  2003-06-22  6:50 ` gdr at integrable-solutions dot net
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-06-22  6:38 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|two-stage name lookup:      |Cannot befriend a template
                   |Cannot befriend a template  |specialization
                   |specialization              |


------- Additional Comments From bangerth at dealii dot org  2003-06-22 06:38 -------
I don't see how this could possibly have anything to do with
the non-existence of two-stage name lookup. It's rather the
_existence_ of two-stage lookup that creates the problem:
when we look at the template A<S>::func, we want to lookup
C::private_func and realize that we're not (always) a friend.

At least that's the theory, because gcc does not implement
two-stage name lookup for functions yet. If it would, it
would spit out the error independent of the instantiation.
Presently, the instantiation is actually needed.

The problem is rather in the fact that AFAICT friend declarations
may not be against specializations -- either the whole template
or nothing.

W.


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

* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
                   ` (2 preceding siblings ...)
  2003-06-22  6:38 ` [Bug c++/11030] " bangerth at dealii dot org
@ 2003-06-22  6:50 ` gdr at integrable-solutions dot net
  2003-06-22 21:03 ` giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-06-22  6:50 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030



------- Additional Comments From gdr at integrable-solutions dot net  2003-06-22 06:50 -------
Subject: Re:  Cannot befriend a template specialization

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

[...]

| The problem is rather in the fact that AFAICT friend declarations
| may not be against specializations -- either the whole template
| or nothing.

Right. A template friend declaration cannot name a specialization.

But, I'll look into the original issue. 

-- Gaby


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

* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
                   ` (3 preceding siblings ...)
  2003-06-22  6:50 ` gdr at integrable-solutions dot net
@ 2003-06-22 21:03 ` giovannibajo at libero dot it
  2003-06-23  7:42 ` gdr at integrable-solutions dot net
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2003-06-22 21:03 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030


giovannibajo at libero dot it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at integrable-solutions
                   |                            |dot net


------- Additional Comments From giovannibajo at libero dot it  2003-06-22 21:03 -------
Gaby,

§14.5.3/1: "A friend of a class or class template can be [...] a specialization 
of a function template or class template, [...]". 

I think that the code is valid, even though I see that it actually gives a lot 
of problems to the compiler, because it has to realize that the function 
friendship is type-dependent (on the template parameter of A, since it matches 
one of its specializations), so the access control should be postponed till A's 
instantiation (due to two-stage name lookup).


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

* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
                   ` (4 preceding siblings ...)
  2003-06-22 21:03 ` giovannibajo at libero dot it
@ 2003-06-23  7:42 ` gdr at integrable-solutions dot net
  2003-07-08 15:36 ` cvs-commit at gcc dot gnu dot org
  2003-07-08 15:37 ` lerdsuwa at gcc dot gnu dot org
  7 siblings, 0 replies; 8+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-06-23  7:42 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030



------- Additional Comments From gdr at integrable-solutions dot net  2003-06-23 06:57 -------
Subject: Re:  Cannot befriend a template specialization

"giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> writes:

| §14.5.3/1: "A friend of a class or class template can be [...] a specialization 
| of a function template or class template, [...]". 

I know.


I concentrated on the reduced testcase and thought it was refering to 
a friend declaration *template* as I said in my previous message.
Sorry for the confusion.

Thanks,

-- Gaby


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

* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
                   ` (5 preceding siblings ...)
  2003-06-23  7:42 ` gdr at integrable-solutions dot net
@ 2003-07-08 15:36 ` cvs-commit at gcc dot gnu dot org
  2003-07-08 15:37 ` lerdsuwa at gcc dot gnu dot org
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-07-08 15:36 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-08 15:35 -------
Subject: Bug 11030

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	lerdsuwa@gcc.gnu.org	2003-07-08 15:35:54

Modified files:
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: friend19.C 

Log message:
	PR c++/11030
	* pt.c (instantiate_class_template): Don't call xref_tag to
	inject name when the friend class is a specialization.
	
	* g++.dg/template/friend19.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3500&r2=1.3501
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.715&r2=1.716
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2849&r2=1.2850
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/friend19.C.diff?cvsroot=gcc&r1=NONE&r2=1.1


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

* [Bug c++/11030] Cannot befriend a template specialization
       [not found] <20030529172554.11030.benxbli@yahoo.com>
                   ` (6 preceding siblings ...)
  2003-07-08 15:36 ` cvs-commit at gcc dot gnu dot org
@ 2003-07-08 15:37 ` lerdsuwa at gcc dot gnu dot org
  7 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2003-07-08 15:37 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030


lerdsuwa at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2003-07-08 15:37 -------
Fixed by

  http://gcc.gnu.org/ml/gcc-patches/2003-07/msg00824.html


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

end of thread, other threads:[~2003-07-08 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030529172554.11030.benxbli@yahoo.com>
2003-06-03 14:56 ` [Bug c++/11030] Cannot befriend a template specialization lerdsuwa@gcc.gnu.org
2003-06-22  1:06 ` [Bug c++/11030] two-stage name lookup: " pinskia at physics dot uc dot edu
2003-06-22  6:38 ` [Bug c++/11030] " bangerth at dealii dot org
2003-06-22  6:50 ` gdr at integrable-solutions dot net
2003-06-22 21:03 ` giovannibajo at libero dot it
2003-06-23  7:42 ` gdr at integrable-solutions dot net
2003-07-08 15:36 ` cvs-commit at gcc dot gnu dot org
2003-07-08 15:37 ` lerdsuwa at gcc dot gnu dot org

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).