This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15770] New: compiler does not reject illegal forward reference


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]