public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29184] New: member template function of template class can't access some private members
@ 2006-09-22 16:19 paul dot otto at canfieldsci dot com
2006-09-22 16:22 ` [Bug c++/29184] " paul dot otto at canfieldsci dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: paul dot otto at canfieldsci dot com @ 2006-09-22 16:19 UTC (permalink / raw)
To: gcc-bugs
--
Summary: member template function of template class can't access
some private members
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paul dot otto at canfieldsci dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29184
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/29184] member template function of template class can't access some private members
2006-09-22 16:19 [Bug c++/29184] New: member template function of template class can't access some private members paul dot otto at canfieldsci dot com
@ 2006-09-22 16:22 ` paul dot otto at canfieldsci dot com
2006-09-22 16:23 ` paul dot otto at canfieldsci dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: paul dot otto at canfieldsci dot com @ 2006-09-22 16:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from paul dot otto at canfieldsci dot com 2006-09-22 16:22 -------
Created an attachment (id=12308)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12308&action=view)
Preprocessed file exhibiting the problem
The templated member contructor is unable to access the private
class members of its const ref argument. Since that argument
is an instance of the same class, my understanding is that it should
be able to.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29184
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/29184] member template function of template class can't access some private members
2006-09-22 16:19 [Bug c++/29184] New: member template function of template class can't access some private members paul dot otto at canfieldsci dot com
2006-09-22 16:22 ` [Bug c++/29184] " paul dot otto at canfieldsci dot com
@ 2006-09-22 16:23 ` paul dot otto at canfieldsci dot com
2006-09-22 16:24 ` paul dot otto at canfieldsci dot com
2006-09-22 16:27 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: paul dot otto at canfieldsci dot com @ 2006-09-22 16:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from paul dot otto at canfieldsci dot com 2006-09-22 16:23 -------
Created an attachment (id=12309)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12309&action=view)
output from gcc -v
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29184
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/29184] member template function of template class can't access some private members
2006-09-22 16:19 [Bug c++/29184] New: member template function of template class can't access some private members paul dot otto at canfieldsci dot com
2006-09-22 16:22 ` [Bug c++/29184] " paul dot otto at canfieldsci dot com
2006-09-22 16:23 ` paul dot otto at canfieldsci dot com
@ 2006-09-22 16:24 ` paul dot otto at canfieldsci dot com
2006-09-22 16:27 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: paul dot otto at canfieldsci dot com @ 2006-09-22 16:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paul dot otto at canfieldsci dot com 2006-09-22 16:24 -------
Created an attachment (id=12310)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12310&action=view)
copy of the error message from gcc on the example input
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29184
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/29184] member template function of template class can't access some private members
2006-09-22 16:19 [Bug c++/29184] New: member template function of template class can't access some private members paul dot otto at canfieldsci dot com
` (2 preceding siblings ...)
2006-09-22 16:24 ` paul dot otto at canfieldsci dot com
@ 2006-09-22 16:27 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-22 16:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-09-22 16:27 -------
No, template classes can only access their own types in that A<int> can only
access the private variables of A<int> and not A<float>.
If you want A<int> to access A<float>'s private variables add to the class:
template<class T2> friend class A;
Which says that A<T> is a friend to A<T2>.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29184
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-22 16:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-22 16:19 [Bug c++/29184] New: member template function of template class can't access some private members paul dot otto at canfieldsci dot com
2006-09-22 16:22 ` [Bug c++/29184] " paul dot otto at canfieldsci dot com
2006-09-22 16:23 ` paul dot otto at canfieldsci dot com
2006-09-22 16:24 ` paul dot otto at canfieldsci dot com
2006-09-22 16:27 ` pinskia 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).