public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: giovannibajo@libero.it
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	gprentice@paradise.net.nz, nobody@gcc.gnu.org
Subject: Re: c++/10832: [2003-05-03] Cannot define an out-of-class explicit specialization of a template constructor of a specialized template class.
Date: Sat, 17 May 2003 08:00:00 -0000	[thread overview]
Message-ID: <20030517080038.11702.qmail@sources.redhat.com> (raw)

Old Synopsis: spurious compiler errors for definition of explicit specialisation of template member function of explicitly specialised class
New Synopsis: [2003-05-03] Cannot define an out-of-class explicit specialization of a template constructor of a specialized template class.

State-Changed-From-To: open->analyzed
State-Changed-By: bajo
State-Changed-When: Sat May 17 08:00:38 2003
State-Changed-Why:
    Confirmed. I propose the following snippet to show the bug:
    
    -----------------------------------------------------
    template <typename DT>
    struct Foo;
    
    template <>
    struct Foo<int>
    {
        long h;
    
        template <typename T>
        Foo(T);
        template <typename T>
        void Bar(T);
    };
    
    template <>
    void Foo<int>::Bar<long>(long v)
    {
        h = v;
    }
    
    template <>
    Foo<int>::Foo<long>(long v)
    {
        h = v;
    }
    
    int main()
    {
        Foo<int> f(12L);
        f.Bar(12L);
    }
    -----------------------------------------------------
    pr10832.cpp:23: error: `Foo<long int>' specified as declarator-id
    pr10832.cpp:23: error: no member function `Foo<long int>' declared in `Foo<int>'
    pr10832.cpp:23: error: invalid function declaration
    
    As you can see, the definition of the specializaiton of
    Bar() is accepted, but the same syntax used to specialize
    the constructor is rejected. This is obviously a bug.
    
    Confirmed up to current mainline.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10832


                 reply	other threads:[~2003-05-17  8:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030517080038.11702.qmail@sources.redhat.com \
    --to=giovannibajo@libero.it \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=gprentice@paradise.net.nz \
    --cc=nobody@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).