[cfe-commits] [patch] Correctly handle a explicit template instantiation definition after a declaration

Rafael Espindola espindola at google.com
Wed Mar 17 17:45:49 PDT 2010


ping?

On 11 March 2010 23:41, Rafael Espindola <espindola at google.com> wrote:
> I am not sure if this patch actually changes any output produced by
> clang, but it might be desirable as a cleanup.
>
> Background: When I first implemented the needsVtable function in
> SemaDeclCXX.cpp Douglas asked that it should return false for
> TSK_ExplicitInstantiationDeclaration. Unfortunately that introduced a
> regression. Finally I was able to debug what was going on. The problem
> is that in code like
>
> ------------------------------------
> class Option {
>  virtual ~Option();
> };
> template <class DataType> class opt : public Option {
>  virtual bool handleOccurrence() {
>  }
> };
> extern template class opt<unsigned>;
> template class opt<unsigned>;
> -------------------------------------
>
> We would call MaybeMarkVirtualMembersReferenced with a method attached
> to the extern template and then decide that we would not need the
> vtable.
>
> Is the patch OK or the real solution is somewhere else?
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>



-- 
Rafael Ávila de Espíndola




More information about the cfe-commits mailing list