c++: undefined local static variable

scott snyder snyder@fnal.gov
Wed Jul 26 14:55:00 GMT 2000


hi -

For a recent cvs version of g++ (2.96 20000724 on i686-pc-linux-gnu),
the following input generates a reference to a symbol that is
not present in the assembly code:

-------------------------------------------------------------------
struct Cleaner
{
  ~Cleaner();
};

template <class T>
void bar ()
{
  static Cleaner cleanup;
}


inline
void foo() { bar<int>(); }
-------------------------------------------------------------------

$ ./cc1plus -quiet x.cc
$ grep cleanup x.s
	pushl	$cleanup.6


The assembly code contains a reference to the symbol `cleanup.6', which
is nowhere defined.

thanks,
sss


More information about the Gcc-bugs mailing list