incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-301) [XLC++ 8.0] bogus error 1540 explicitly instantiating class template before definition
Date Fri, 03 Nov 2006 22:18:16 GMT
[XLC++ 8.0] bogus error 1540 explicitly instantiating class template before definition
--------------------------------------------------------------------------------------

                 Key: STDCXX-301
                 URL: http://issues.apache.org/jira/browse/STDCXX-301
             Project: C++ Standard Library
          Issue Type: Bug
          Components: External
         Environment: IBM XLC++ 8.0
            Reporter: Martin Sebor


PMR 02310,K78,000

The well-formed program below fails to compile with XLC++ 8.0 on AIX (I haven't checked Linux).
It compiles successfully with XLC++ 7.0.

$ cat t.cpp && xlC -qversion && xlC -c t.cpp

template <class> 
struct A {
    static int foo ();
    static int bar (int);
};


template <class, class> class B;

template <class T, class U>
struct C {
    int operator*() { return U::bar (b->baz ()); }

    B<T, U> *b;
};

template <class, class U>
struct D {
    void barf (U);
};

template struct D<int, C<int, A<int> > >;

template <class, class U>
struct B {
    int baz ();

    virtual int foobar (int i = U::foo ()) { return i; }
};


template <class T, class U>
void D<T, U>::barf (U u)
{
    *u;
}
IBM XL C/C++ Enterprise Edition V8.0 for AIX   
Version: 08.00.0000.0010  
"t.cpp", line 28.33: 1540-0062 (S) The incomplete class "U" must not be used as a qualifier.
"t.cpp", line 12.39: 1540-0700 (I) The previous message was produced while processing "struct
B<int,A<int> >".


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message