public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21614] New: invokation of undefined class'es method is ignored
@ 2005-05-17  6:14 yuri at tsoft dot com
  2005-05-17 17:23 ` [Bug c++/21614] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2005-05-17  6:14 UTC (permalink / raw)
  To: gcc-bugs

gcc 4.0.0 generates code that has line (**) ignored (nothing is invoked in it's
place).

I am not sure in what kind of relationship does this code stand with C++ standard.

But although structure X::Z is undefined, technically method Y::r can be invoked
safely since X::Z definition isn't required for this.

This code used to compile and work fine -- line (**) was invoked.

Yuri


--begin code--
class X;
class Y;

class X {
public:
  struct Z;
  typedef void (Z::* R) (unsigned int ss);

  void   rr (unsigned int ss);

  Y*    d;
};

class Y {
public:
  X::R  r;
  X::Z* d;
  Y*    n;
  Y(X::R _r, X::Z* _d) : r(_r), d(_d) { }
};

extern void ck();

void  X::rr (unsigned int ss) {
  for (Y* l = d;  l;  l = l->n) {
    ck();
    ((l->d)->*(l->r))(ss); // (**) ignored line
    ck();
  }
}
--end code--

-- 
           Summary: invokation of undefined class'es method is ignored
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuri at tsoft dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-07-06 20:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-17  6:14 [Bug c++/21614] New: invokation of undefined class'es method is ignored yuri at tsoft dot com
2005-05-17 17:23 ` [Bug c++/21614] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-05-17 17:38 ` yuri at tsoft dot com
2005-05-17 17:48 ` pinskia at gcc dot gnu dot org
2005-05-17 17:52 ` [Bug c++/21614] [4.0 regression] wrong code when calling member function of undefined class bangerth at dealii dot org
2005-05-17 18:04 ` [Bug c++/21614] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-05-17 18:05 ` pinskia at gcc dot gnu dot org
2005-05-28  2:00 ` mmitchel at gcc dot gnu dot org
2005-05-28  2:21 ` cvs-commit at gcc dot gnu dot org
2005-05-28  2:26 ` mmitchel at gcc dot gnu dot org
2005-05-28  2:26 ` cvs-commit at gcc dot gnu dot org
2005-05-28  2:49 ` mmitchel at gcc dot gnu dot org
2005-07-06 20:50 ` cvs-commit 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).