[clang] [Clang] Fix crash on `void{}` (PR #147514)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 8 06:09:29 PDT 2025


================
@@ -5,3 +5,12 @@ void f()
   // CHECK: store i32 0
   int i{};
 }
+
+
+namespace GH116440 {
+void f() {
+  void{};
+  void();
+}
----------------
erichkeane wrote:

Just the function header then `CHECK-NEXT: ret void` confirms that it actually does nothing/makes it through codegen without going sideways.

So:
```
// CHECK: define{{.*}} void @{{.*}}GH116440{{.*}}()
// CHECK-NEXT: {{.*}}:
// CHECK-NEXT: ret void
```

That should work on both windows and itanium manglers, though be more specific on the function name if this test uses a triple.




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


More information about the cfe-commits mailing list