This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

symbols not resolved... symbols not generated?


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:

Bar.h

template <typename Foo>
class Bar {
...
public:
  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'
(unresolved).

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).

Thanks,
  Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]