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] Commented: (STDCXX-157) [XLC++ 8.0/Linux] explicit instantiation fails to emit some symbols
Date Wed, 01 Mar 2006 20:19:05 GMT
    [ http://issues.apache.org/jira/browse/STDCXX-157?page=comments#action_12368350 ] 

Martin Sebor commented on STDCXX-157:
-------------------------------------

Here's a more obvious test case that shows how this actually causes a problem:

$ cat t.cpp && xlC -F /package/1/ppc64/compilers/ibm/va80/vac.cfg -c t.cpp &&
xlC -F /package/1/ppc64/compilers/ibm/va80/vac.cfg -Dmain=main -c t.cpp -o a.o &&
xlC -F /package/1/ppc64/compilers/ibm/va80/vac.cfg a.o t.o
template <class T> T foo (T t) { return t; }

template <class T>
struct S
{
    T bar () { return foo (T ()); }
    void baz () { foo<T>(0); }
};

#ifdef main

extern template struct S<int>;

int main ()
{
    return S<int>().bar ();
}

#else
template struct S<int>;
#endif
a.o(.text+0x1c): In function `main':
: undefined reference to `S<int>::bar()'


> [XLC++ 8.0/Linux] explicit instantiation fails to emit some symbols
> -------------------------------------------------------------------
>
>          Key: STDCXX-157
>          URL: http://issues.apache.org/jira/browse/STDCXX-157
>      Project: C++ Standard Library
>         Type: Bug
>   Components: External
>  Environment: $ uname -sr && xlC -qversion
> Linux 2.6.5-7.191-pseries64
> IBM XL C/C++ Advanced Edition V8.0 for Linux   
> Version: 08.00.0000.0000
>     Reporter: Martin Sebor

>
> PMR 02236,K78,000
> XLC++ 8.0 fails to emit a symbol for the member function S<int>::bar() in the program
below.
> $ cat t.cpp && xlC -c t.cpp && echo xlc: && nm -C t.o &&
> echo gcc: && gcc -c t.cpp && nm -C t.o
> template <class T> T foo (T t) { return t; }
> template <class T>
> struct S
> {
>     T bar () { return foo (T ()); }
>     void baz () { foo<T>(0); }
> };
> template struct S<int>;
> xlc:
>          U __IBMCPlusPlusExceptionV2
> 00000000 W int foo<int>(int)
> 00000014 W S<int>::baz()
> gcc:
> 00000000 W int foo<int>(int)
> 00000000 W S<int>::bar()
> 00000000 W S<int>::baz()

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