public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mps at sonartech dot com dot au" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/13825] New: template instantiation fails due to substituting the wrong type for a parameter
Date: Fri, 23 Jan 2004 05:08:00 -0000	[thread overview]
Message-ID: <20040123050818.13825.mps@sonartech.com.au> (raw)

The following code is correct, I think, but gcc 3.3.2 rejects it.

Its messages say it's doing an instantiation with B_PARAM=int.
I think that's it's mistake.


template <typename A_PARAM>
struct A {};

template <typename B_PARAM>
struct B {
    template <typename B1_PARAM>
    struct B1 {
        B1 (B_PARAM);
    };
};

template <typename C_PARAM>
struct C {
    typedef A <C_PARAM> a_t;

    typename B <a_t>::B1 <a_t>  _b1;

    C () : _b1 (a_t ()) {}
};

int
main ()
{
    C <int> c;
}

-- 
           Summary: template instantiation fails due to substituting the
                    wrong type for a parameter
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mps at sonartech dot com dot au
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: What's a triplet anyway?
  GCC host triplet: Intel Debian Linux 2.4.22
GCC target triplet: Not cross-compiling


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


             reply	other threads:[~2004-01-23  5:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23  5:08 mps at sonartech dot com dot au [this message]
2004-01-23  5:28 ` [Bug c++/13825] " pinskia at gcc dot gnu dot org

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=20040123050818.13825.mps@sonartech.com.au \
    --to=gcc-bugzilla@gcc.gnu.org \
    --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).