[clang] [clang] Limit lifetimes of temporaries to the full expression (PR #170517)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 6 04:17:23 PST 2025


mstorsjo wrote:

I’m seeing failures after this commit:
```c++
void a();
struct b {};
typedef enum {} c;
c d;
struct e {
  e(b = b());
};
void f() {
  switch (d) {
  g:
    new e;
  default:
    a();
  }
}
```

```console
$ clang -target x86_64-linux-gnu -O2 -c repro.cpp
Instruction does not dominate all uses!
  %call = call noalias noundef nonnull ptr @_Znwm(i64 noundef 1) #5
  call void @_ZdlPvm(ptr noundef %call, i64 noundef 1) #7
fatal error: error in backend: Broken module found, compilation aborted!
```

Will push a revert soon.

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


More information about the cfe-commits mailing list