This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15770] New: compiler does not reject illegal forward reference
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jun 2004 06:53:49 -0000
- Subject: [Bug c++/15770] New: compiler does not reject illegal forward reference
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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