This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
G++ BUG: __PRETTY_FUNCTION__ still not quite right
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: G++ BUG: __PRETTY_FUNCTION__ still not quite right
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 01 Dec 1999 14:40:35 +0000
- CC: mark at codesourcery dot com
- Reply-To: nathan at compsci dot bristol dot ac dot uk
Hi,
Here's an xfailing test which shows a problem remaining with
__PRETTY_FUNCTION__ and __FUNCTION__ in template functions.
In a templated function (but not a specialization), a static
declaration of the __PRETTY__FUNCTION__ variable is always
emitted (even if never used). This prevents inlining,
and bloats the object file :-(
ok to install test?
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
Never hand someone a gun unless you are sure where they will point it
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk
// Build don't link:
// Special g++ Options: -ansi -pedantic-errors -O2 -Winline
// Copyright (C) 1999 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 1 Dec 1999 <nathan@acm.org>
// __PRETTY_FUNCTION__ and __FUNCTION__ should not be emitted
// when they're not needed. This causes inlining to fail.
template <class T> inline void foo(T)
{ // gets bogus error - warning can't inline - XFAIL *-*-*
}
template <> inline void foo (float)
{
}
void fn()
{
foo (0); // gets bogus error - warning can't inline - XFAIL *-*-*
foo (0.0f);
}