[PATCH] D52674: [AST] Add Obj-C discriminator to MS ABI RTTI

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 14 00:47:35 PST 2018


rjmccall added a comment.

In https://reviews.llvm.org/D52674#1297893, @smeenai wrote:

> In https://reviews.llvm.org/D52674#1297879, @rjmccall wrote:
>
> > I'm not worried about the mangler being re-used for multiple declarations, I'm worried about a global flag changing how we mangle all components of a type when we only mean to change it at the top level.
>
>
> Hmm, but don't we want it to affect all components? For example, consider something like:
>
>   @interface I
>   @end
>  
>   template <class T> class C {};
>  
>   void f();
>   void g() {
>     try {
>       f();
>     } catch (C<I> *) {
>     }
>   }
>
>
> I would say that we want the RTTI for `C<I> *` to have the discriminator for `I`.


Why?  IIUC, you're adding the discriminator to distinguish between two different RTTI objects.  It's not like there are two different types.  You should mangle `C<I>` normally here.


Repository:
  rC Clang

https://reviews.llvm.org/D52674





More information about the cfe-commits mailing list