[clang] [clang][bytecode] Fix crash in void functions returning non-void expr… (PR #176550)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 18 02:04:11 PST 2026


================
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify %s
+
+constexpr void foo(int n) {
+  return n > 1 ? foo(n - 1) : 0; // expected-error {{return type 'void' must match the return type 'int' of the expression}}
+}
+static_assert((foo(2), true), "");
----------------
Serosh-commits wrote:

added it dude The code from 
gh176536.cpp
 is now at the end of 
functions.cpp
 inside a namespace GH176536.

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


More information about the cfe-commits mailing list