Skip to content

Commit

Permalink
[C11] Claim conformance to WG14 N1514
Browse files Browse the repository at this point in the history
This paper made Annex G a normative, but conditionally supported,
annex. Clang does not implement Annex G, so we conform to this paper.
  • Loading branch information
AaronBallman committed Apr 9, 2024
1 parent 910d2de commit f48895a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions clang/test/C/C11/n1514.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// RUN: %clang_cc1 -verify -std=c11 %s
// expected-no-diagnostics

/* WG14 N1514: Yes
* Conditional normative status for Annex G
*/

// We don't support Annex G (which introduces imaginary types), but support for
// this annex is conditional in C11. So we can test for conformance to this
// paper by ensuring we don't define the macro claiming we support Annex G.

#ifdef __STDC_IEC_559_COMPLEX__
#error "when did this happen??"
#endif
5 changes: 4 additions & 1 deletion clang/www/c_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ <h2 id="c11">C11 implementation status</h2>
<tr>
<td>Conditional normative status for Annex G</td>
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1514.pdf">N1514</a></td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Yes <a href="#annex-g">(1)</a></td>
</tr>
<tr>
<td>Creation of complex value</td>
Expand Down Expand Up @@ -606,6 +606,9 @@ <h2 id="c11">C11 implementation status</h2>
<td class="unknown" align="center">Unknown</td>
</tr>
</table>
<span id="annex-g">(1): Clang does not implement Annex G, so our conditional support
conforms by not defining the <code>__STDC_IEC_559_COMPLEX__</code> macro.
</span>
</details>

<h2 id="c17">C17 implementation status</h2>
Expand Down

0 comments on commit f48895a

Please sign in to comment.