This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21614] New: invokation of undefined class'es method is ignored
- From: "yuri at tsoft dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2005 06:14:36 -0000
- Subject: [Bug c++/21614] New: invokation of undefined class'es method is ignored
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc 4.0.0 generates code that has line (**) ignored (nothing is invoked in it's
place).
I am not sure in what kind of relationship does this code stand with C++ standard.
But although structure X::Z is undefined, technically method Y::r can be invoked
safely since X::Z definition isn't required for this.
This code used to compile and work fine -- line (**) was invoked.
Yuri
--begin code--
class X;
class Y;
class X {
public:
struct Z;
typedef void (Z::* R) (unsigned int ss);
void rr (unsigned int ss);
Y* d;
};
class Y {
public:
X::R r;
X::Z* d;
Y* n;
Y(X::R _r, X::Z* _d) : r(_r), d(_d) { }
};
extern void ck();
void X::rr (unsigned int ss) {
for (Y* l = d; l; l = l->n) {
ck();
((l->d)->*(l->r))(ss); // (**) ignored line
ck();
}
}
--end code--
--
Summary: invokation of undefined class'es method is ignored
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: yuri at tsoft dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21614