public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC 3.4.0 and template type resolution bug
@ 2004-04-29  7:53 Rene Rebe
  2004-04-29  8:04 ` GCC 3.4.0 and template type resolution bug (no) Michael Veksler
  2004-04-29  9:08 ` GCC 3.4.0 and template type resolution bug Vladimir Prus
  0 siblings, 2 replies; 6+ messages in thread
From: Rene Rebe @ 2004-04-29  7:53 UTC (permalink / raw)
  To: gcc; +Cc: valentin

Hi,

compiling one of our C++ projects I found a quite strange behaviour
(==bug?) of gcc-3.4.0. The 3.4.0 version is not able to deduce m_info
in the base template class's when the inherited class is a template,
too. Although it does work with normal classes. (Of course the code
does compile with earlier version of GCC - such as 3.2.3.)


  template <typename INFO>
  class Basic
  {
  protected:

    INFO* m_info;
  };

  template <typename INFO>
  class Std : public Basic <INFO>
  {
  public:

    bool testMe () { return m_info != 0; }
  };

  class Normal : public Basic <int>
  {
  public:
    bool testMe () { return m_info != 0; }
  };

int main () {
  return 0;
}

The error is:

gcc34-template.cc: In member function `bool Std<INFO>::testMe()':
gcc34-template.cc:15: error: `m_info' undeclared (first use this function)
gcc34-template.cc:15: error: (Each undeclared identifier is reported only once for each function it appears in.)

Sincerely yours,
  René Rebe
    - ROCK Linux stable release maintainer

--  
René Rebe - Europe/Germany/Berlin
  rene@rocklinux.org rene@rocklinux-consulting.de
http://www.rocklinux.org http://www.rocklinux-consulting.de

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

end of thread, other threads:[~2004-04-29 11:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-29  7:53 GCC 3.4.0 and template type resolution bug Rene Rebe
2004-04-29  8:04 ` GCC 3.4.0 and template type resolution bug (no) Michael Veksler
2004-04-29 11:45   ` Rene Rebe
2004-04-29 12:15     ` GCC 3.4.0 and template type resolution bug (OT) Michael Veksler
2004-04-29 12:19     ` GCC 3.4.0 and template type resolution bug (no) Giovanni Bajo
2004-04-29  9:08 ` GCC 3.4.0 and template type resolution bug Vladimir Prus

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