[clang] Fix crash on defaulted comparison recovery in Sema and AST (PR #210668)

purnima shrivastava via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 02:03:52 PDT 2026


purnima-nlp wrote:

> Ok, I think this is true of any default comparison operator as you can repro with
> 
> ```c++
>   struct B {
>     friend bool operator==(const B&, const B&) = default;
>     static_assert(B{} == B{});
>   };
> ```
> 
> @Sirraide I _think_ the issue is that `DefineDefaultedComparison` needs to be deferred until the class definition is complete, but I'm unsure how in class `static_assert`ions work if they're dependent on the class def being completed (e.g. is @purnima-nlp going to have to do anything complex for first time contributor?)

Yes this is my first complex issue, I'm freakingly curious about this issue, like how it can be solved, I loved exploring the sema codebase.
I have a list of doubts , I will send here soon once it's complete (will add more) .

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


More information about the cfe-commits mailing list