public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21498] New: clause 7.1.5.3/2 of the c++ is not enforced
@ 2005-05-10 16:18 jkherciueh at gmx dot net
2005-05-10 16:31 ` [Bug c++/21498] " pinskia at gcc dot gnu dot org
2005-08-14 16:48 ` fn_x at hotmail dot com
0 siblings, 2 replies; 3+ messages in thread
From: jkherciueh at gmx dot net @ 2005-05-10 16:18 UTC (permalink / raw)
To: gcc-bugs
The following code should be rejected, but is accepted by g++:
template < typename T >
class identity {
public:
typedef T me;
};
template < typename T >
class my_friend {
private:
friend class identity< T >::me;
char x;
};
class The_T {
public:
static
char & peek_friend ( my_friend< The_T > & f ) {
return( f.x );
}
};
int main (void) {
my_friend< The_T > x;
}
The configuration is:
gcc> g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.0/configure --prefix=/pkg/gcc-4.0.0/usr
Thread model: posix
gcc version 4.0.0
The code is illegal because the friend declaration resolves into the
typedef "me" (7.1.5.3/2).
PS: I do not really understand why the standard is worded this way.
It appears that templated friendship could be good.
--
Summary: clause 7.1.5.3/2 of the c++ is not enforced
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jkherciueh at gmx dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21498
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/21498] clause 7.1.5.3/2 of the c++ is not enforced
2005-05-10 16:18 [Bug c++/21498] New: clause 7.1.5.3/2 of the c++ is not enforced jkherciueh at gmx dot net
@ 2005-05-10 16:31 ` pinskia at gcc dot gnu dot org
2005-08-14 16:48 ` fn_x at hotmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-10 16:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-10 16:31 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |accepts-invalid
Known to fail| |2.95.3 3.0.4 3.2.3 3.3.3
| |3.4.0 4.0.0 4.1.0
Last reconfirmed|0000-00-00 00:00:00 |2005-05-10 16:31:02
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21498
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/21498] clause 7.1.5.3/2 of the c++ is not enforced
2005-05-10 16:18 [Bug c++/21498] New: clause 7.1.5.3/2 of the c++ is not enforced jkherciueh at gmx dot net
2005-05-10 16:31 ` [Bug c++/21498] " pinskia at gcc dot gnu dot org
@ 2005-08-14 16:48 ` fn_x at hotmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: fn_x at hotmail dot com @ 2005-08-14 16:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fn_x at hotmail dot com 2005-08-14 16:48 -------
*** Bug 23385 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |fn_x at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21498
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-14 16:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-10 16:18 [Bug c++/21498] New: clause 7.1.5.3/2 of the c++ is not enforced jkherciueh at gmx dot net
2005-05-10 16:31 ` [Bug c++/21498] " pinskia at gcc dot gnu dot org
2005-08-14 16:48 ` fn_x at hotmail dot com
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).