public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paul Ianna" <paulianna2002@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: problem with a structure nested within a template
Date: Tue, 21 Nov 2006 18:05:00 -0000	[thread overview]
Message-ID: <75975c320611211004h7ee9528arb0daf00738342452@mail.gmail.com> (raw)

Hi All,

I'm perplexed and hoping to obtain some guru insight from the community.

The code below is a snippet from some existing code that compiles with
many other compilers, but not gcc (I tried both 3.4.4 and 4.1.1
versions).

The problem line is:  C1<U>::Node*    pNode;

and the error is:  error: expected `;' before '*' token

If I use a concrete type (e.g., C1<int>), all is well.

Thanks in advance,
Paul


///////////////////////////////////////
template<typename T>
class C1
{
public:

   struct Node
   {
      T*     prev;
      T*     next;
   };

   Node   myNode;
};



///////////////////////////////////////
template<typename U>
class C2
{
public:

   U                       someObj;
   C1<U>::Node*    pNode;
};


///////////////////////////////////////
int main()
{
   C1<int> c1;

   C2<int> c2;

   return 0;
}

             reply	other threads:[~2006-11-21 18:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 18:05 Paul Ianna [this message]
2006-11-21 18:28 ` Young, Michael
2006-11-21 18:40   ` Young, Michael

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=75975c320611211004h7ee9528arb0daf00738342452@mail.gmail.com \
    --to=paulianna2002@gmail.com \
    --cc=gcc-help@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).