http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54314
--- Comment #27 from Jason Merrill <jason at gcc dot gnu.org> 2013-01-28 15:42:57 UTC --- (In reply to comment #26) > 1) Just add the check. We will then miss all devirtualization oppurtunities > through the construction vtable. The front end does devirtualization itself for calls within constructors, so the impact of this isn't likely to be too bad. > what happens on targets not supporting visibility? I think that setting DECL_VISIBILITY should do the trick even if it isn't reflected in the assembly output. I added the DECL_ARTIFICIAL check to default_assemble_visibility so that this wouldn't cause warnings. > 3) Perhaps we can use DECL_VALUE_EXPR or somethin similar to keep track of > the canonical way to reffer into tthe construction vtable? (i.e. by > reference > to vtable) We can then lower all direct references to the indirect > references late, i.e. in expansion? Hmm, that makes sense.