[clang] Fix crash with modules and constexpr destructor (PR #69076)

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 27 14:37:03 PST 2023


hahnjo wrote:

I finally had time to debug this: The reason for modules being involved here is because the serialization code calls `ParmVarDecl::getDefaultArg()` which strips the outermost `FullExpr`, such as `ExprWithCleanups`. A potential fix is in https://github.com/llvm/llvm-project/pull/76473 though I'm not really convinced by this asymmetry between `getInit()` but calling `setDefaultArg()`. However, removing the handling of `FullExpr` in `setDefaultArg()` causes a total 29 test failures, so that's not an (easy) option...

Personally, I would argue that adding `FullExpressionRAII` makes the code more robust against the absence of `ExprWithCleanups` so that's maybe a good thing to have regardless of fixing the serialization code.

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


More information about the cfe-commits mailing list