[clang] [clang] Fix issue #117960 (PR #121039)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 30 02:49:44 PST 2024


cor3ntin wrote:

Thanks for the PR. Can you update the commit message to be more descriptive?

I'm not sure the fix is sufficient.
I think most of the checks done in `ActOnEnumBody` should be (re) performed on instantiation.

Maybe we should instead

- Add a new `BuildEnumBody` function, move most (all?) the implementation of  `ActOnEnumBody` to that
- call `BuildEnumBody` from both `ActOnEnumBody` and `RebuildEnumType`

That would not only fix the crash but also the fact that we are seemingly missing a lot of diagnostics
https://godbolt.org/z/17dTW4dEe


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


More information about the cfe-commits mailing list