| Issue |
115658
|
| Summary |
Constructing, destructing and returning a value of arbitrary type T causes static assertion failure inside LLVM's frontend
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
TymianekPL
|
Program: x86-64 clang 19.1.0 (assertions)
Example: [Compiler Explorer](https://godbolt.org/z/PWKsa6Tfc)
Log (same output inside the CE link above): [clang-log.txt](https://github.com/user-attachments/files/17691513/clang-log.txt)
Given the code:
```cpp
void nop(void) noexcept
{
typedef int T;
return T{}.~T();
}```
LLVM frontend crashes with assertion failure:
```
clang++: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:10704: bool EvaluateTemporary(const clang::Expr*, {anonymous}::LValue&, {anonymous}::EvalInfo&): Assertion `E->isPRValue() && E->getType()->isRecordType()' failed.```
Removing `return` keyword and leaving `T{}.~T();` compiles successfully.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs