================
@@ -54,6 +54,7 @@
namespace clang {
class ASTContext;
+class DeclStateReverter;
----------------
jaredwy wrote:
On the friend question specifically. There's one real grant in the diff,
`CXXRecordDecl` -> `DeclStateReverter` for `DefinitionData`. Everything else
goes through `struct XAccess : Base { using Base::M; }` and a `static_cast` to
it, eight times. That cast is UB when the object isn't an `XAccess`, and `Decl`
is polymorphic so `-fsanitize=vptr` will catch it. Those eight structs are the
friend list you're avoiding, and `ASTDeclUnmerger` already has two of them
(`Redeclarable`, `CXXRecordDecl`). That's the other half of what I meant by
extending the access and using friends. `classifyShape` is also a fourth
partition on top of the three above.
https://github.com/llvm/llvm-project/pull/223305
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits