This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/10832: [2003-05-03] Cannot define an out-of-class explicit specialization of a template constructor of a specialized template class.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]