[Bug c++/13740] ICE when mangling template which uses typeof
kruus at nec-labs dot com
gcc-bugzilla@gcc.gnu.org
Fri Apr 13 17:15:00 GMT 2007
------- Comment #11 from kruus at nec-labs dot com 2007-04-13 18:15 -------
A possibly shorter testcase for this bug.
template <class T> void func( T x ) {
struct foo { static void bar( typeof(x) a ) { ; } };
foo::bar(x);
}
int main(int,char**) { int i=2; func(i); }
Also bugs with `typeof typedef' outside foo.
But OK with `bar( T &a )'
(I wanted something like this while using macros to generate
__attribute__((noinline)) `bar' calls so that debug stuff in headers
wouldn't kill gcc inlining --- unexecuted if(0) code counts to inlining
limits and moving it to and inner foo::bar can greatly help inlining.
It worked great as long as typeof has no relation to any template type
parameter)
This was with gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8)
g++ -c bug0.cc -o bug0.o
// /usr/libexec/gcc/i686-redhat-linux/4.0.2/cc1plus -quiet -D_GNU_SOURCE
bug0.cc -quiet -dumpbase bug0.cc -mtune=pentiumpro -auxbase-strip bug0.o -o -
-frandom-seed=0
--
kruus at nec-labs dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kruus at nec-labs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13740
More information about the Gcc-bugs
mailing list