Skip to content

Commit d99cfa0

Browse files
committed
[C99] Claim conformance to WG14 N631 and WG14 N696
Both of these relate to handling of standard pragmas. N631 is about various STDC pragmas being included in the standard at all, and N696 is about whether macros are expanded in standard pragmas (they're not).
1 parent a9d1fea commit d99cfa0

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

clang/test/C/C99/n696.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %clang_cc1 -verify %s
2+
3+
/* WG14 N696: yes
4+
* Standard pragmas - improved wording
5+
*
6+
* NB: this also covers N631 which changed these features into pragmas rather
7+
* than macros.
8+
*/
9+
10+
// Verify that we do not expand macros in STDC pragmas. If we expanded them,
11+
// this code would issue diagnostics.
12+
#define ON 12
13+
#pragma STDC FENV_ACCESS ON
14+
#pragma STDC CX_LIMITED_RANGE ON
15+
#pragma STDC FP_CONTRACT ON
16+
17+
// If we expanded macros, this code would not issue diagnostics.
18+
#define BLERP OFF
19+
#pragma STDC FENV_ACCESS BLERP // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
20+
#pragma STDC CX_LIMITED_RANGE BLERP // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
21+
#pragma STDC FP_CONTRACT BLERP // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
22+

clang/www/c_status.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ <h2 id="c99">C99 implementation status</h2>
330330
</tr>
331331
<tr>
332332
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n631.htm">N631</a></td>
333-
<td class="unknown" align="center">Unknown</td>
333+
<td class="full" align="center">Yes</td>
334334
</tr>
335335
<tr>
336336
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n696.ps">N696</a></td>
337-
<td class="unknown" align="center">Unknown</td>
337+
<td class="full" align="center">Yes</td>
338338
</tr>
339339
<tr>
340340
<td>__func__ predefined identifier</td>

0 commit comments

Comments
 (0)