public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15770] New: compiler does not reject illegal forward reference
@ 2004-06-02  6:53 jbeulich at novell dot com
  2004-06-02  6:55 ` [Bug c++/15770] " jbeulich at novell dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jbeulich at novell dot com @ 2004-06-02  6:53 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-04 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02  6:53 [Bug c++/15770] New: compiler does not reject illegal forward reference jbeulich at novell dot com
2004-06-02  6:55 ` [Bug c++/15770] " jbeulich at novell dot com
2004-06-02 11:37 ` pinskia at gcc dot gnu dot org
2004-06-02 14:15 ` [Bug c++/15770] [3.4/3.5 regression] " bangerth at dealii dot org
2004-06-04 20:17 ` mmitchel at gcc dot gnu dot org

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).