aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2022-08-06 11:52:28 -0400
committerAaron Ballman <aaron@aaronballman.com>2022-08-06 11:53:40 -0400
commit486a3c4662cb052329b96537da18893d73138b64 (patch)
treeb5db0d6c08b089988b568577702633a0e2043a8d
parentd6eea96b8e0401786bf7fa47ff97b52981cc4a24 (diff)
Update some of the C99-era DRs starting in the 300s.
-rw-r--r--clang/test/C/drs/abc_123.h1
-rw-r--r--clang/test/C/drs/dr3xx.c93
-rw-r--r--clang/www/c_dr_status.html22
3 files changed, 105 insertions, 11 deletions
diff --git a/clang/test/C/drs/abc_123.h b/clang/test/C/drs/abc_123.h
new file mode 100644
index 000000000000..2ce0e2c88045
--- /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 000000000000..de25c4d5e35b
--- /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 59ed6defa44c..3d0a64b73150 100644
--- a/clang/www/c_dr_status.html
+++ b/clang/www/c_dr_status.html
@@ -1753,49 +1753,49 @@ conformance.</p>
<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 &lt;fenv.h&gt;</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 @@ conformance.</p>
<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 @@ conformance.</p>
<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 @@ conformance.</p>
<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>