You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2006/11/03 23:18:16 UTC

[jira] Created: (STDCXX-301) [XLC++ 8.0] bogus error 1540 explicitly instantiating class template before definition

[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

        

[jira] Commented: (STDCXX-301) [XLC++ 8.0] bogus error 1540-0062 explicitly instantiating class template before definition

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-301?page=comments#action_12450534 ] 
            
Martin Sebor commented on STDCXX-301:
-------------------------------------

I think the original test case can be simplified to this:

$ cat t.cpp && xlC -qversion && xlC -c t.cpp
struct A;
template <class T> struct B { void foo (T = T::foo ()); };
template struct B<A>;
struct A { int foo (); };

IBM XL C/C++ Enterprise Edition V8.0 for AIX   
Version: 08.00.0000.0010  
"t.cpp", line 2.43: 1540-0062 (S) The incomplete class "A" must not be used as a qualifier.
"t.cpp", line 3.17: 1540-0700 (I) The previous message was produced while processing "struct B<A>".


> [XLC++ 8.0] bogus error 1540-0062 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

        

[jira] Commented: (STDCXX-301) [XLC++ 8.0] bogus error 1540-0062 explicitly instantiating class template before definition

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-301?page=comments#action_12455052 ] 
            
Martin Sebor commented on STDCXX-301:
-------------------------------------

Created PMR 02312 for the smaller test case from http://issues.apache.org/jira/browse/STDCXX-301#action_12450534.

> [XLC++ 8.0] bogus error 1540-0062 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

        

[jira] Commented: (STDCXX-301) [XLC++ 8.0] bogus error 1540-0062 explicitly instantiating class template before definition

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-301?page=comments#action_12452502 ] 
            
Martin Sebor commented on STDCXX-301:
-------------------------------------

-------- Original Message --------
Subject: IBM - PMR 02310,K78,000 - compile error with template
Date: 	Mon, 20 Nov 2006 10:21:12 -0500
From: 	Nim Li <ni...@ca.ibm.com>
To: 	Martin Sebor <se...@roguewave.com>

Hello Martin,

For your first test case, the problem is triggered by the template 
parameter which is used as the default argument in a function.   When 
the compiler attempts to resolve the template parameter as a regular 
name in this situation, the compilation error occurs.  As a workaround, 
we suggest you not to use the default argument with template parameter. 
 Currently, we are still working on the permanent fix.  

When I test your second test case, once I remove the default argument in 
the foo() function, I have no problem to compile the program.  As a 
result, I determine it is due to the same issue.  At the same time, I 
have sent your second test case to our development team; when they work 
on the fix, they will look into it as well.

I will follow up with you no later than November 30.

If you have any questions or concerns, please let me know.

Thank you,

Nim Li
XL C/C++ and Fortran Support
IBM Toronto Software Lab
Phone: +1 905-413-5204
C/C++ Compiler Support Page: 
http://www.ibm.com/software/awdtools/ccompilers/support/
XL Fortran Support Page: 
http://www.ibm.com/software/awdtools/fortran/xlfortran/support/
zOS C/++ Support Page: http://www.ibm.com/software/awdtools/czos/support/




*Martin Sebor <se...@roguewave.com>*

11/16/2006 04:49 PM

	
To: Nim Li/Toronto/IBM@IBMCA
cc: 
Subject: Re: IBM - PMR 02310,K78,000 - compile error with template


Nim Li wrote:
 >
 > Hello,
 >
 > Regarding the subject PMR, we have identified the cause of the issue.
 >  We will continue to work on your PMR.  I will provide you a progress
 > update no later than November 24.
 >
 > If you have any questions or concerns, please let me know.

I think the original test case can be reduced to the one below.
Could you please pass it on to development and let ne know if
you all agree that it is in fact the same bug?

Thanks
Martin

$ cat t.cpp && xlC -qversion && xlC -c t.cpp
struct A;
template <class T> struct B { void foo (T = T::foo ()); };
template struct B<A>;
struct A { int foo (); };

IBM XL C/C++ Enterprise Edition V8.0 for AIX
Version: 08.00.0000.0010
"t.cpp", line 2.43: 1540-0062 (S) The incomplete class "A" must not be
used as a qualifier.
"t.cpp", line 3.17: 1540-0700 (I) The previous message was produced
while processing "struct B<A>".

 >
 > Thank you,
 >
 > Nim Li
 > XL C/C++ and Fortran Support
 > IBM Toronto Software Lab
 > Phone: +1 905-413-5204
 > C/C++ Compiler Support Page:
 > http://www.ibm.com/software/awdtools/ccompilers/support/
 > XL Fortran Support Page:
 > http://www.ibm.com/software/awdtools/fortran/xlfortran/support/
 > zOS C/++ Support Page: http://www.ibm.com/software/awdtools/czos/support/
 >
 >
 >
 >
 > *Nim Li/Toronto/IBM*
 >
 > 11/06/2006 11:54 AM
 >
 >                  
 > To
 >                  sebor@roguewave.com
 > cc
 >                  
 > Subject
 >                  IBM - PMR 02310,K78,000 - compile error with template
 >
 >
 >                  
 >
 >
 >
 >
 > Hello,
 >
 > I am from the IBM's C/C++ compiler support team.  I can reproduce the
 > problem with XL C/C++ V8.  I will create an internal report for our
 > develop team to continue the investigation; then, provide you a progress
 > update by early next week.  
 >
 > If you have any questions, please let me know.
 >
 > Thank you,
 >
 > Nim Li
 > XL C/C++ and Fortran Support
 > IBM Toronto Software Lab
 > Phone: +1 905-413-5204
 > C/C++ Compiler Support Page:
 > http://www.ibm.com/software/awdtools/ccompilers/support/
 > XL Fortran Support Page:
 > http://www.ibm.com/software/awdtools/fortran/xlfortran/support/
 > zOS C/++ Support Page: http://www.ibm.com/software/awdtools/czos/support/


> [XLC++ 8.0] bogus error 1540-0062 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

        

[jira] Updated: (STDCXX-301) [XLC++ 8.0] bogus error 1540-0062 explicitly instantiating class template before definition

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-301?page=all ]

Martin Sebor updated STDCXX-301:
--------------------------------

    Summary: [XLC++ 8.0] bogus error 1540-0062 explicitly instantiating class template before definition  (was: [XLC++ 8.0] bogus error 1540 explicitly instantiating class template before definition)

> [XLC++ 8.0] bogus error 1540-0062 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