Author: Aaron Ballman Date: 2022-08-06T11:53:40-04:00 New Revision: 486a3c4662cb052329b96537da18893d73138b64
URL: https://github.com/llvm/llvm-project/commit/486a3c4662cb052329b96537da18893d73138b64 DIFF: https://github.com/llvm/llvm-project/commit/486a3c4662cb052329b96537da18893d73138b64.diff LOG: Update the status of some more C DRs Update some of the C99-era DRs starting in the 300s. Added: clang/test/C/drs/abc_123.h clang/test/C/drs/dr3xx.c Modified: clang/www/c_dr_status.html Removed: ################################################################################ diff --git a/clang/test/C/drs/abc_123.h b/clang/test/C/drs/abc_123.h new file mode 100644 index 0000000000000..2ce0e2c88045d --- /dev/null +++ b/clang/test/C/drs/abc_123.h @@ -0,0 +1 @@ +#define WE_SUPPORT_DR302 diff --git a/clang/test/C/drs/dr3xx.c b/clang/test/C/drs/dr3xx.c new file mode 100644 index 0000000000000..de25c4d5e35bc --- /dev/null +++ b/clang/test/C/drs/dr3xx.c @@ -0,0 +1,93 @@ +/* RUN: %clang_cc1 -std=c89 -fsyntax-only -Wvla -verify -pedantic -Wno-c11-extensions %s + RUN: %clang_cc1 -std=c99 -fsyntax-only -Wvla -verify -pedantic -Wno-c11-extensions %s + RUN: %clang_cc1 -std=c11 -fsyntax-only -Wvla -verify -pedantic %s + RUN: %clang_cc1 -std=c17 -fsyntax-only -Wvla -verify -pedantic %s + RUN: %clang_cc1 -std=c2x -fsyntax-only -Wvla -verify -pedantic %s + */ + +/* The following are DRs which do not require tests to demonstrate + * conformance or nonconformance. + * + * WG14 DR300: yes + * Translation-time expresssion evaluation + * + * WG14 DR301: yes + * Meaning of FE_* macros in <fenv.h> + * + * WG14 DR303: yes + * Breaking up the very long sentence describing preprocessing directive + * + * WG14 DR307: yes + * Clarifiying arguments vs. parameters + * + * WG14 DR308: yes + * Clarify that source files et al. need not be "files" + * + * WG14 DR310: yes + * Add non-corner case example of trigraphs + * + * WG14 DR312: yes + * Meaning of "known constant size" + */ + + +/* WG14 DR302: yes + * Adding underscore to portable include file name character set + */ +#include "./abc_123.h" +#ifndef WE_SUPPORT_DR302 +#error "Oh no, we don't support DR302 after all!" +#endif + +/* WG14 DR304: yes + * Clarifying illegal tokens in #if directives + */ +/* expected-error@+3 {{invalid token at start of a preprocessor expression}} + expected-warning@+3 {{missing terminating ' character}} + */ +#if 'test +#endif + +/* WG14 DR305: yes + * Clarifying handling of keywords in #if directives + */ +#if int +#error "We definitely should not have gotten here" +#endif + +/* WG14 DR306: yes + * Clarifying that rescanning applies to object-like macros + */ +#define REPLACE 1 +#define THIS REPLACE +#if THIS != 1 +#error "We definitely should not have gotten here" +#endif + +/* WG14 DR309: yes + * Clarifying trigraph substitution + */ +int dr309??(1??) = { 1 }; /* expected-warning {{trigraph converted to '[' character}} + expected-warning {{trigraph converted to ']' character}} + */ + +/* WG14 DR311: yes + * Definition of variably modified types + */ +void dr311(int x) { + typedef int vla[x]; /* expected-warning {{variable length array}} */ + + /* Ensure that a constant array of variable-length arrays are still + * considered a variable-length array. + */ + vla y[3]; /* expected-warning {{variable length array}} */ +} + +/* WG14 DR313: + * Incomplete arrays of VLAs + */ +void dr313(int i) { + int c[][i] = { 0 }; /* expected-error {{variable-sized object may not be initialized}} + expected-warning {{variable length array}} + */ +} diff --git a/clang/www/c_dr_status.html b/clang/www/c_dr_status.html index 59ed6defa44c0..3d0a64b731500 100644 --- a/clang/www/c_dr_status.html +++ b/clang/www/c_dr_status.html @@ -1753,49 +1753,49 @@ <h2 id="cdr">C defect report implementation status</h2> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_300.htm">300</a></td> <td>NAD</td> <td>Translation-time expresssion evaluation</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="301"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_301.htm">301</a></td> <td>NAD</td> <td>Meaning of FE_* macros in <fenv.h></td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="302"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_302.htm">302</a></td> <td>C99</td> <td>6.10.2p5: Adding underscore to portable include file name character set</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="303"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_303.htm">303</a></td> <td>C99</td> <td>6.10p2: Breaking up the very long sentence describing preprocessing directive</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="304"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_304.htm">304</a></td> <td>C99</td> <td>Clarifying illegal tokens in #if directives</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="305"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_305.htm">305</a></td> <td>C99</td> <td>6.10.1p3: Clarifying handling of keywords in #if directives</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="306"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_306.htm">306</a></td> <td>C99</td> <td>6.10.3p9: Clarifying that rescanning applies to object-like macros</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="307"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_307.htm">307</a></td> <td>C99</td> <td>6.10.3p10: Clarifiying arguments vs. parameters</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="308"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_308.htm">308</a></td> @@ -1807,7 +1807,7 @@ <h2 id="cdr">C defect report implementation status</h2> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_309.htm">309</a></td> <td>C99</td> <td>Clarifying trigraph substitution</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="310"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_310.htm">310</a></td> @@ -1819,7 +1819,7 @@ <h2 id="cdr">C defect report implementation status</h2> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_311.htm">311</a></td> <td>C99</td> <td>Definition of variably modified types</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="312"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_312.htm">312</a></td> @@ -1831,7 +1831,7 @@ <h2 id="cdr">C defect report implementation status</h2> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_313.htm">313</a></td> <td>NAD</td> <td>Incomplete arrays of VLAs</td> - <td class="unknown" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="314"> <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_314.htm">314</a></td> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits