[Bug c++/15770] New: compiler does not reject illegal forward reference
jbeulich at novell dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 2 06:53:00 GMT 2004
In the code below, ddd::test() gets referenced from ttt<ddd>::test() (called
from ccc::test(), in turn called from test(ccc&)) prior to the definition of ddd
being visible. 3.3.x (unless exceptions were disabled) properly rejected this code.
class bbb {
public:
void test();
};
template<typename T> class ttt {
T*p;
public:
void test() { p->test(); }
};
class ddd;
class ccc {
ttt<ddd> m;
public:
void test() { m.test(); }
};
void test(ccc&r) {
r.test();
}
class ddd : public bbb {};
--
Summary: compiler does not reject illegal forward reference
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbeulich at novell dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15770
More information about the Gcc-bugs
mailing list