public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: "Frank Chow" <fzhou@mtone.com.cn>
Cc: "gcc-bugs@gcc.gnu.org" <gcc-bugs@gcc.gnu.org>
Subject: Re: GCC 3.4.0: a derived class can't access the data member of a template base class
Date: Mon, 21 Jun 2004 16:50:00 -0000	[thread overview]
Message-ID: <or7ju097of.fsf@livre.redhat.lsd.ic.unicamp.br> (raw)
In-Reply-To: <SERVER05tX60LUDA1Xi00000d5a@server05.mtone.com.cn>


> template <typename T> struct D : public T { D() { nSize = sizeof(T);
> } };


nSize is not a template-dependent name, so it's bound at parse time,
rather than at template instantiation time.  You must use this->nSize
or T::nSize to make it template-dependent.

> By the way, gcc (GCC) 3.3.1 (cygwin version) can compile this code
> successfully

That was a bug, fixed in 3.4.

> so do Visual C++ .Net (cl v 13.10.3077).

You'll have to report this bug to someone else, then :-)

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


      reply	other threads:[~2004-06-21 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-21  9:10 Frank Chow
2004-06-21 16:50 ` Alexandre Oliva [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=or7ju097of.fsf@livre.redhat.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=fzhou@mtone.com.cn \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).