assembler problem with numeric template-arguments
Thomas Kunert
kunert@Ptprs1.phy.tu-dresden.de
Mon Jan 19 23:51:00 GMT 1998
Hi,
The following code doesn't compile.
[tom@ptpp09 c++]$ cat h1.cc
template <int N> class A{};
template <int N1, int N2>
A < (N1 < N2 ? N1 : N2) > f( A<N1>, A<N2> )
{
return A< (N1 < N2 ? N1 : N2 ) > ();
}
int main()
{
f( A<1>(), A<2>() );
return 0;
}
[tom@ptpp09 c++]$ g++ h1.cc
/tmp/cca20137.s: Assembler messages:
/tmp/cca20137.s:66: Error: Rest of line ignored. First ignored character
is `*'.
/tmp/cca20137.s:67: Error: ignoring unrecognized symbol type ""
/tmp/cca20137.s:67: Error: Rest of line ignored. First ignored character
is `*'.
/tmp/cca20137.s:68: Error: invalid character '_' in opcode
/tmp/cca20137.s:93: Error: expected comma after name
`f__H2i1i2_Gt1A1iY01Gt1A1iY11_t1A1i' in .size directive
/tmp/cca20137.s:93: Error: Rest of line ignored. First ignored character
is `*'.
[tom@ptpp09 c++]$ g++ -v
Reading specs from /opt/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.04/specs
gcc version egcs-2.91.04 980115 (gcc-2.8.0 release)
[tom@ptpp09 c++]$ as --version
GNU assembler 980114
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License. This program has absolutely no
warranty.
This assembler was configured for a target of `i586-pc-linux-gnu'.
[tom@ptpp09 c++]$
The assembler code looks like this:
64: .section .gnu.linkonce.t.f__H2i1i2_Gt1A1iY01Gt1A1iY11_t1A1i
*0,"ax",@progbits
65: .align 4
66: .weak f__H2i1i2_Gt1A1iY01Gt1A1iY11_t1A1i *0
67: .type f__H2i1i2_Gt1A1iY01Gt1A1iY11_t1A1i *0,@function
68: f__H2i1i2_Gt1A1iY01Gt1A1iY11_t1A1i *0:
The same Problem I get with egcs-1.0.1 and gcc-2.8.0.
I have tried this on AIX and get similar messages.
Regards,
Thomas Kunert
More information about the Gcc
mailing list