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

* [Bug c++/15770] compiler does not reject illegal forward reference
  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 ` jbeulich at novell dot com
  2004-06-02 11:37 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jbeulich at novell dot com @ 2004-06-02  6:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |3.3.1 3.3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15770


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

* [Bug c++/15770] compiler does not reject illegal forward reference
  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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-02 11:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-02 11:37 -------
I actually think this is valid but I have not looked it up in the standard, note ICC 6.0 even in strict mode 
accepts this code.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15770


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

* [Bug c++/15770] [3.4/3.5 regression] compiler does not reject illegal forward reference
  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 ` bangerth at dealii dot org
  2004-06-04 20:17 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-06-02 14:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-06-02 14:15 -------
Confirmed, a regression in 3.4 and mainline. We seem to fail to 
expand the body of the (inlined) member function at the point 
of its definition. 
 
FWIW, icc71 rejects this code in strict mode. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-02 14:15:17
               date|                            |
            Summary|compiler does not reject    |[3.4/3.5 regression]
                   |illegal forward reference   |compiler does not reject
                   |                            |illegal forward reference
   Target Milestone|---                         |3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15770


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

* [Bug c++/15770] [3.4/3.5 regression] compiler does not reject illegal forward reference
  2004-06-02  6:53 [Bug c++/15770] New: compiler does not reject illegal forward reference jbeulich at novell dot com
                   ` (2 preceding siblings ...)
  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
  3 siblings, 0 replies; 5+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-04 20:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-04 20:17 -------
This is not a bug.  The standard does not say that the compiler must actually
instantiate ttt<ddd>::test before ddd is complete.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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