[clang] Fix consteval initializers of temporaries
When a potential immediate invocation is met, it is immediately wrapped by a `ConstantExpr`. There is also a TreeTransform that removes this `ConstantExpr` wrapper when corresponding expression evaluation context is popped. So, in case initializer was an immediate invocation, `CXXTemporaryObjectExpr` was wrapped by a `ConstantExpr`, and that caused additional unnecessary `CXXFunctionalCastExpr` to be added, which later confused the TreeTransform that rebuilds immediate invocations, so it was adding unnecessary constructor call. Fixes https://github.com/llvm/llvm-project/issues/60286 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D146801
Loading
Please sign in to comment