[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 9 21:03:09 PDT 2018


rjmccall added a comment.

In https://reviews.llvm.org/D53046#1259945, @erik.pilkington wrote:

> In https://reviews.llvm.org/D53046#1259933, @rjmccall wrote:
>
> > The linking does actually happen in this test case, right?  Can we just do something when linking them to unify their `Common` structures?
>
>
> Yep, that would work too I think. We can't properly merge in the general case, because we could have to decide between more than one identical instantiations of different template redecls, but in this case the only ordering problem is with the injected template arguments, which I believe we can merge (by just discarding the new arguments, if a previous redeclaration already has some). It would definitely be less intrusive, but its a more complicated invariant. Do you think that is a better solution? I could go either way.


Well, we're really still in the middle of creating the new declaration, so I'm not too worried about the invariants.  And yeah, we can safely discard the new arguments because IIUC this is just a cache.


Repository:
  rC Clang

https://reviews.llvm.org/D53046





More information about the cfe-commits mailing list