[clang] [Clang] Fix stmtexprs.c to explicitly require -std=c11 (PR #226161)
ahmed mohamed kamel via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 24 06:24:36 PDT 2026
https://github.com/AhmedKamel10 created https://github.com/llvm/llvm-project/pull/226161
Fixes a buildbot failure (llvm-clang-x86_64-sie-ubuntu-fast) where `stmtexprs.c` didn't specify a C standard, causing `_Static_assert` and `_Generic` to be flagged as C11 extensions on targets that default to an older standard.
Adds `-std=c11` to the RUN line.
Follow-up to #225597.
>From 04be4c182dbf1454685dc97c05a16705b0153ddc Mon Sep 17 00:00:00 2001
From: ahmedkamel10 <amkzaher at gmail.com>
Date: Thu, 24 Sep 2026 16:15:32 +0300
Subject: [PATCH] [Clang] Fix stmtexprs.c: explicitly require -std=c11 to avoid
pedantic warnings on pre-C11-default targets
---
clang/test/Sema/stmtexprs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/Sema/stmtexprs.c b/clang/test/Sema/stmtexprs.c
index baddba18445c82..75fe57c58aea27 100644
--- a/clang/test/Sema/stmtexprs.c
+++ b/clang/test/Sema/stmtexprs.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-gnu-statement-expression
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -std=c11 -Wno-gnu-statement-expression
int stmtexpr_fn(void);
void stmtexprs(int i) {
More information about the cfe-commits
mailing list