| Issue |
165017
|
| Summary |
[Clang][CodeGen] Investigate possible missed case for trivial ctor constant handling
|
| Labels |
clang,
clang:codegen,
ClangIR
|
| Assignees |
|
| Reporter |
andykaylor
|
There is a case in `ConstantExprEmitter::VisitCXXConstructExpr` where we are handling trivial constructor calls with arguments, and if the argument _expression_ is not a `MaterializeTemporaryExpr` we just return nullptr (meaning we don't emit a constant here). There is a comment that says "Don't try to support arbitrary lvalue-to-rvalue conversions for now." but when reviewing this code for the CIR-equivalent handling (https://github.com/llvm/llvm-project/pull/164849), @erichkeane raised concerns that this didn't seem right.
There are around a dozen places in the `clang/CodeGenCXX` tests where the dyn_cast to `MaterializeTemporaryExpr` fails, but none of them appear to be constant. I haven't been able to create a case that hits this location with a constant, but I'm not certain that it isn't possible. Even if it does happen, there's a chance that we'd generate the correct code somewhere else.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs