symbols not resolved... symbols not generated?

Brian Budge
Fri Apr 17 23:24:00 GMT 2009

Hi all -

I'm running into an issue using static const variables in my template
class, but only with -O0.  I have something like this:


template <typename Foo>
class Bar {
  typedef uint32_t SomeType;
  static const SomeType A = 0;
  static const SomeType B = 1;
  static const SomeType C = 2;

These types are used in Bar member functions, as well as by Foo (who
knows who he is an argument for).

In -O1 and above, it looks like the symbols are never generated, and
this is fine since it's probably folded into the code.  In O0, which
I'm using for debugging, the symbols appear in my object file as 'U'

I can't seem to make a simple repro case for this, but I thought I'd
throw this up here to see if I'm doing something stupid, or if this is
a bug in gcc (version 4.3.3-5).


More information about the Gcc-help mailing list