[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-bugs
Subject: c++:new-abi (de)mangler inconsistent with curried template
From: Larry Evans <jcampbell3 () prodigy ! net>
Date: 2000-07-30 20:17:50
[Download RAW message or body]
The following cc1plus run with -fnew-abi, followed by c++filt with -s
gnu-new-abi shows that the new-abi mangler and demangler are not
consistent.
The c++filt output shows:
.type B<B<A>::C<A> >::C<int>::C(),@function
however, the output should be:
.type B<B<A>::C >::C<int>::C(),@function
This conclusion is supported by the output from error.c
(dump_function_decl), shown in the first lines of the output from
cc1plus. It's also supported by the realization that B takes a
template, not a class, as argument; however, B<A>::C<A>, the argument
to the outermost B in the c++filt output, is a class, not a template.
-------------------
uname -a
Linux localhost.localdomain 2.2.13-4mdk #1 Tue Sep 7 18:23:11 CEST 1999
i586 unknown
bin.dir/g++ -v
Reading specs from bin.dir/../lib/gcc-lib/i586-pc-linux/2.96/specs
gcc version 2.96 20000717 (experimental)
-------------------
cat bug2.cpp
template
< typename S
>
struct
A
{
};
template
< template<typename S>class T
>
struct
B
{
template
< typename U
>
struct
C
{
C(void);
};
};
typedef B<A> B1;
typedef B<B1::C> B2;
B2::C<int>::C(void){};
-------------------
obj.dir/cc1plus -fnew-abi bug2.cpp
B<T>::C<U>::C () [with U = int, T = B<A>::C]
B<T>::C<U>::C () [with U = int, T = B<A>::C]
B<T>::C<U>::C () [with U = int, T = B<A>::C]
B<T>::C<U>::C () [with U = int, T = B<A>::C]
B<T>::C<U>::C () [with U = int, T = B<A>::C]
Execution times (seconds)
parser : 0.02 (33%) usr 0.00 ( 0%) sys 0.07 (54%)
wall
expand : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.02 (15%)
wall
varconst : 0.01 (17%) usr 0.00 ( 0%) sys 0.01 ( 8%)
wall
integration : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
jump : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
flow analysis : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
local alloc : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
global alloc : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
flow 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
shorten branches : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
reg stack : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
final : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
symout : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
rest of compilation : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
TOTAL : 0.06 0.00 0.13
-------------------
bin.dir/c++filt -s gnu-new-abi < bug2.s
.file "bug2.cpp"
.version "01.01"
gcc2_compiled.:
.text
.align 16
.globl B<B<A>::C<A> >::C<int>::C()
.type B<B<A>::C<A> >::C<int>::C(),@function
B<B<A>::C<A> >::C<int>::C():
.LFB1:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
movl 8(%ebp), %eax
popl %ebp
ret
.LFE1:
.Lfe1:
.size B<B<A>::C<A> >::C<int>::C(),.Lfe1-B<B<A>::C<A>
>::C<int>::C()
.align 16
.globl B<B<A>::C<A> >::C<int>::C()
.type B<B<A>::C<A> >::C<int>::C(),@function
B<B<A>::C<A> >::C<int>::C():
.LFB2:
pushl %ebp
.LCFI2:
movl %esp, %ebp
.LCFI3:
movl 8(%ebp), %eax
popl %ebp
ret
.LFE2:
.Lfe2:
.size B<B<A>::C<A> >::C<int>::C(),.Lfe2-B<B<A>::C<A>
>::C<int>::C()
.ident "GCC: (GNU) 2.96 20000717 (experimental)"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic