Skip to content

Commit f48895a

Browse files
committed
[C11] Claim conformance to WG14 N1514
This paper made Annex G a normative, but conditionally supported, annex. Clang does not implement Annex G, so we conform to this paper.
1 parent 910d2de commit f48895a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

clang/test/C/C11/n1514.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %clang_cc1 -verify -std=c11 %s
2+
// expected-no-diagnostics
3+
4+
/* WG14 N1514: Yes
5+
* Conditional normative status for Annex G
6+
*/
7+
8+
// We don't support Annex G (which introduces imaginary types), but support for
9+
// this annex is conditional in C11. So we can test for conformance to this
10+
// paper by ensuring we don't define the macro claiming we support Annex G.
11+
12+
#ifdef __STDC_IEC_559_COMPLEX__
13+
#error "when did this happen??"
14+
#endif

clang/www/c_status.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ <h2 id="c11">C11 implementation status</h2>
568568
<tr>
569569
<td>Conditional normative status for Annex G</td>
570570
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1514.pdf">N1514</a></td>
571-
<td class="unknown" align="center">Unknown</td>
571+
<td class="full" align="center">Yes <a href="#annex-g">(1)</a></td>
572572
</tr>
573573
<tr>
574574
<td>Creation of complex value</td>
@@ -606,6 +606,9 @@ <h2 id="c11">C11 implementation status</h2>
606606
<td class="unknown" align="center">Unknown</td>
607607
</tr>
608608
</table>
609+
<span id="annex-g">(1): Clang does not implement Annex G, so our conditional support
610+
conforms by not defining the <code>__STDC_IEC_559_COMPLEX__</code> macro.
611+
</span>
609612
</details>
610613

611614
<h2 id="c17">C17 implementation status</h2>

0 commit comments

Comments
 (0)