I accidentally broke friend destructor declarations in D130936.
Modify it to skip performing the destructor name check if we have a dependent friend declaration.
Differential D131541
[Sema] Fix friend destructor declarations after D130936 royjacobson on Aug 9 2022, 10:48 PM. Authored by
Details I accidentally broke friend destructor declarations in D130936. Modify it to skip performing the destructor name check if we have a dependent friend declaration.
Diff Detail
Event TimelineComment Actions Hi @hubert.reinterpretcast, thanks for the quick catch! I have posted this initial patch, but it still misses the case template <typename T> struct E { friend T::S::~V(); }; Something goes wrong there that I haven't figured out yet. Do you think I should land this as-is to fix the master?
Comment Actions Updated the patch and added more test coverage. I still don't diagnose the dependent friend case, but I didn't see how to do it easily.
Comment Actions This LGTM; thanks! Maybe adding code to TemplateDeclInstantiator::VisitFriendDecl will do the trick.
|
There's nothing we can diagnose about this without an instantiation (because S could be an alias for a class having V as the injected-class-name).
It is, however, true that we don't diagnose this even with problematic instantiations: