public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10832: [2003-05-03] Cannot define an out-of-class explicit specialization of a template constructor of a specialized template class.
@ 2003-05-17  8:00 giovannibajo
  0 siblings, 0 replies; only message in thread
From: giovannibajo @ 2003-05-17  8:00 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gprentice, nobody

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-17  8:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-17  8:00 c++/10832: [2003-05-03] Cannot define an out-of-class explicit specialization of a template constructor of a specialized template class giovannibajo

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