[cfe-dev] Should adding 'final' to a C++11 class change linking behavior?

Jeff Walden jwalden+clang at mit.edu
Mon Nov 21 10:13:23 PST 2011


Should adding 'final' to a class change linking behavior?

I have a class which I'd like to mark as final.  Nothing inherits from it, so it should be fine to mark it as such.  However, when I do so, I get a bunch of undefined-reference warnings linking code that uses pointers to that class.  (The class itself is never instantiated.)  My understanding was that 'final' solely prevented inheritance/overriding, and I'd think that any linking failure like this would be a bug.  Is that understanding correct?

Producing a reduced testcase from this situation may be tricky, so I'd like to know if I'm missing something obvious before trying to make one.

Jeff



More information about the cfe-dev mailing list