[PATCH] D131541: [Sema] Fix friend destructor declarations after D130936

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 10 20:28:12 PDT 2022


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:11518-11520
+      // FIXME: We still don't diagnose on this case
+      // template <class T>
+      // struct A { friend T::S::~V(); };
----------------
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:
```
struct R { struct V; ~R(); };
struct QQ { using S = R; };

template <class T>
struct A { friend T::S::~V(); };

A<QQ> a;
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131541/new/

https://reviews.llvm.org/D131541



More information about the cfe-commits mailing list