[clang] 468d2e7 - [Clang] Document when to use ExtWarn and Extension (#223440)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 21 03:29:40 PDT 2026
Author: Nikolas Klauser
Date: 2026-09-21T12:29:33+02:00
New Revision: 468d2e73112a8e9f5fae4e21ad53526a7dc03262
URL: https://github.com/llvm/llvm-project/commit/468d2e73112a8e9f5fae4e21ad53526a7dc03262
DIFF: https://github.com/llvm/llvm-project/commit/468d2e73112a8e9f5fae4e21ad53526a7dc03262.diff
LOG: [Clang] Document when to use ExtWarn and Extension (#223440)
Added:
Modified:
clang/docs/InternalsManual.md
Removed:
################################################################################
diff --git a/clang/docs/InternalsManual.md b/clang/docs/InternalsManual.md
index 0d9ee745927aa..c2925563aa388 100644
--- a/clang/docs/InternalsManual.md
+++ b/clang/docs/InternalsManual.md
@@ -114,6 +114,17 @@ severe that error recovery won't be able to recover sensibly from them (thus
spewing a ton of bogus errors). One example of this class of error is failure
to `#include` a file.
+##### Extension vs ExtWarn
+
+Deciding whether to use `Extension` or `ExtWarn` can be
diff icult.
+`ExtWarn` should be used if one of the following applies (or another good reason is stated):
+- the extension is likely to be used incorrectly (e.g. `-Wvla`);
+- the diagnosed code is likely wrong (e.g. `-Wmain`);
+- the extension is likely surprising in some cases (e.g. `SFINAEFailure`);
+- the extension is deprecated (e.g. `-Wauto-storage-class`).
+
+`Extension` should be used in all other circumstances.
+
#### Diagnostic Wording
The wording used for a diagnostic is critical because it is the only way for a
More information about the cfe-commits
mailing list