[clang] [Clang][Docs] Clarify extension handling for -std (PR #245192)

Raiyyan via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 03:18:17 PST 2026


https://github.com/7se7en72025 created https://github.com/llvm/llvm-project/pull/245192

Clang may accept language extensions in a selected standard mode. Clarify this in the `-std` entry and link to the `-pedantic-errors` option.

Verified on Windows with Clang 23.1.6. A GNU statement expression passed a C++20 syntax check and produced the expected error with `-pedantic-errors`. The updated Markdown page rendered locally with Sphinx warnings treated as errors using the generated files from the 23.1.6 docs build.

Refs #39694.

Assisted-by: OpenAI Codex

>From 5db561e4047cfb9177ad287e9f900f2171090b0e Mon Sep 17 00:00:00 2001
From: 7se7en72025 <218611947+7se7en72025 at users.noreply.github.com>
Date: Mon, 23 Nov 2026 16:45:06 +0530
Subject: [PATCH] [Clang][Docs] Clarify extension handling for -std

Refs #39694.

Assisted-by: OpenAI Codex
---
 clang/docs/CommandGuide/clang.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/docs/CommandGuide/clang.md b/clang/docs/CommandGuide/clang.md
index aa234b8ed20904..55c098075abb9f 100644
--- a/clang/docs/CommandGuide/clang.md
+++ b/clang/docs/CommandGuide/clang.md
@@ -101,6 +101,9 @@ Treat subsequent input files as having type language.
 :::{option} -std=<standard>
 Specify the language standard to compile for.
 
+Clang may still accept language extensions in the selected mode. Use
+{option}`-pedantic-errors` to report diagnosed language extensions as errors.
+
 Supported values for the C language are:
 
 > `c89`



More information about the cfe-commits mailing list