[clang] [Clang] Fix stmtexprs.c to explicitly require -std=c11 (PR #226161)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 06:25:23 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: ahmed mohamed kamel (AhmedKamel10)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/226161.diff


1 Files Affected:

- (modified) clang/test/Sema/stmtexprs.c (+1-1) 


``````````diff
diff --git a/clang/test/Sema/stmtexprs.c b/clang/test/Sema/stmtexprs.c
index baddba18445c8..75fe57c58aea2 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) {

``````````

</details>


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


More information about the cfe-commits mailing list