Skip to content

Conversation

@AaronBallman
Copy link
Collaborator

I tracked down the document which changed the way variables are handled in for loops for C99, it was the same document that allowed mixing code and declarations but the editor's report made it seem like the features came from different papers.

This is an extension we backported to C89 but it's sufficiently distinct in the tracking page so I've added it explicitly to the backported features documentation.

I tracked down the document which changed the way variables are handled
in for loops for C99, it was the same document that allowed mixing code
and declarations but the editor's report made it seem like the features
came from different papers.

This is an extension we backported to C89 but it's sufficiently
distinct in the tracking page so I've added it explicitly to the
backported features documentation.
@llvmbot
Copy link
Member

llvmbot commented Aug 21, 2025

@llvm/pr-subscribers-clang

Author: Aaron Ballman (AaronBallman)

Changes

I tracked down the document which changed the way variables are handled in for loops for C99, it was the same document that allowed mixing code and declarations but the editor's report made it seem like the features came from different papers.

This is an extension we backported to C89 but it's sufficiently distinct in the tracking page so I've added it explicitly to the backported features documentation.


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

2 Files Affected:

  • (modified) clang/docs/LanguageExtensions.rst (+1)
  • (modified) clang/www/c_status.html (+1-6)
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 1b749ead355c7..3c6c97bb1fa10 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -1763,6 +1763,7 @@ Hexadecimal floating constants (N308)                                          C
 Compound literals (N716)                                                       C99           C89, C++
 ``//`` comments (N644)                                                         C99           C89
 Mixed declarations and code (N740)                                             C99           C89
+init-statement in for (N740)                                                   C99           C89
 Variadic macros (N707)                                                         C99           C89
 Empty macro arguments (N570)                                                   C99           C89
 Trailing comma in enum declaration                                             C99           C89
diff --git a/clang/www/c_status.html b/clang/www/c_status.html
index dcff2fc2b1a3e..5b31f97e7a2e5 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -1302,15 +1302,10 @@ <h2 id="c99">C99 implementation status</h2>
       <td class="full" align="center">Yes</td>
     </tr>
     <tr>
-      <td>mixed declarations and code</td>
+      <td>mixed declarations and code<br \>new block scopes for selection and iteration statements</td>
       <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n740.htm">N740</a></td>
       <td class="full" align="center">Yes</td>
     </tr>
-    <tr>
-      <td>new block scopes for selection and iteration statements</td>
-      <td>Unknown</td>
-      <td class="full" align="center">Yes</td>
-    </tr>
     <tr>
       <td>integer constant type rules</td>
       <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n629.htm">N629</a></td>

@AaronBallman AaronBallman enabled auto-merge (squash) August 21, 2025 12:42
@AaronBallman AaronBallman merged commit a33e505 into llvm:main Aug 21, 2025
14 checks passed
@AaronBallman AaronBallman deleted the aballman-selection-scope-docs branch August 21, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category documentation website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants