This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/3613: no instantiation of explicitly initialized static template member variaibles on alphas
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/3613: no instantiation of explicitly initialized static template member variaibles on alphas
- From: sts at ica dot uni-stuttgart dot de
- Date: 9 Jul 2001 09:47:22 -0000
- Reply-To: sts at ica dot uni-stuttgart dot de
>Number: 3613
>Category: c++
>Synopsis: no instantiation of explicitly initialized static template member variaibles on alphas
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 09 02:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: sts@ica1.uni-stuttgart.de
>Release: gcc-3.0
>Organization:
>Environment:
alpha OSF 5.0
>Description:
The following piece of code does not link on alpha/OSF5.0.
If the '=0' in the static initialization is removed, the code compiles
fine. On non-alpha platforms, I have not observed this problem.
11:22 tiger_sts:~/bugs/gnu> uname -a
OSF1 tiger.ica1.uni-stuttgart.de V5.0 910 alpha
11:22 tiger_sts:~/bugs/gnu> g++ static.cc
/bin/ld:
Unresolved:
A<0>::our
collect2: ld returned 1 exit status
11:22 tiger_sts:~/bugs/gnu> g++ -v
Reading specs from /local/gcc-3.0/lib/gcc-lib/alphaev56-dec-osf4.0f/3.0/specs
Configured with: /share/src/gcc-3.0/configure --prefix=/local/gcc-3.0 --host=alp
haev56-dec-osf4.0f --target=alphaev56-dec-osf4.0f
Thread model: single
gcc version 3.0
11:22 tiger_sts:~/bugs/gnu> cat static.cc
template<int N>
struct A {
static int our;
};
template<int N>
int A<N>::our = 0;
int main(){
return A<0>::our;
}
>How-To-Repeat:
// on alpha, try to compile
template<int N>
struct A {
static int our;
};
template<int N>
int A<N>::our = 0;
int main(){
return A<0>::our;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: