[clang] [AST] Assert that FoldingSetNodeID used for hint is correct upon insertion (PR #157692)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 10 01:31:24 PDT 2025


ilya-biryukov wrote:

> I think having to call a separate thing at every use site is a bit prone to error. 

I fully agree.  "requires discipline" in my previous comment alludes to that exactly.

> Can't we just check this at `InsertNode` instead?

I initially thought it's not possible because we don't have the ID there, but I think you're right and we could just try to recompute `InsertPos` and check it's the same as suggested. I'll try that approach and update this PR.


https://github.com/llvm/llvm-project/pull/157692


More information about the cfe-commits mailing list