[clang] 6450dad - Test a few more C99 DRs

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 1 10:54:24 PDT 2022


Author: Aaron Ballman
Date: 2022-07-01T13:54:11-04:00
New Revision: 6450daddd20a83327118c0c6fa8f844a99cd1f0f

URL: https://github.com/llvm/llvm-project/commit/6450daddd20a83327118c0c6fa8f844a99cd1f0f
DIFF: https://github.com/llvm/llvm-project/commit/6450daddd20a83327118c0c6fa8f844a99cd1f0f.diff

LOG: Test a few more C99 DRs

This updates the status for another 8 DRs.

Added: 
    

Modified: 
    clang/test/C/drs/dr2xx.c
    clang/www/c_dr_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/C/drs/dr2xx.c b/clang/test/C/drs/dr2xx.c
index e4fe3183b02c9..b34b7ef2cce79 100644
--- a/clang/test/C/drs/dr2xx.c
+++ b/clang/test/C/drs/dr2xx.c
@@ -17,6 +17,21 @@
  *
  * WG14 DR215: yes
  * Equality operators
+ *
+ * WG14 DR218: yes
+ * Signs of non-numeric floating point values
+ *
+ * WG14 DR219: yes
+ * Effective types
+ *
+ * WG14 DR221: yes
+ * Lacuna in pointer arithmetic
+ *
+ * WG14 DR222: yes
+ * Partially initialized structures
+ *
+ * WG14 DR234: yes
+ * Miscellaneous Typos
  */
 
 
@@ -87,3 +102,45 @@ void dr216(void) {
   A('}'); A('~');
 #undef A
 }
+
+/* WG14 DR230: yes
+ * Enumerated type rank
+ */
+void dr230(void) {
+  enum E {
+    Value = __INT_MAX__
+  } e;
+  /* The enumeration type has a compatible type that is a signed or unsigned
+   * integer type, or char. But it has to be large enough to hold all of the
+   * values of the enumerators. So it needs to be at least int or unsigned int.
+   *
+   * The integer conversion rank for an enumeration is the same as its
+   * compatible type (C99 6.3.1.1p1), so it's eligible for integer promotions
+   * to either int or unsigned int, depending on the compatible type
+   * (C99 6.3.1.1p2).
+   */
+  (void)_Generic(e, int : 1, unsigned int : 1);
+  (void)_Generic((enum E)Value, int : 1, unsigned int : 1);
+  /* The enumerators themselves have type int (C99 6.7.2.2p3). */
+  (void)_Generic(Value, int : 1);
+}
+
+/* WG14 DR231: no
+ * Semantics of text-line and non-directive
+ *
+ * One of the preprocessing groups to support is # non-directive (C99 6.10p1),
+ * which is defined as pp-tokens followed by a newline. However, we fail to
+ * translate the program if we don't recognize the directive, and we don't take
+ * note when what follows the # is not a valid preprocessing token.
+ */
+
+/* FIXME: this should not fail. */
+# nope /* expected-error {{invalid preprocessing directive}} */
+
+/* FIXME: this should fail, but not because of the unknown directive; it should
+ * fail because of the invalid preprocessing-token.
+ */
+# 'a
+/* expected-error at -1 {{invalid preprocessing directive}} \
+   expected-warning at -1 {{missing terminating ' character}}
+*/

diff  --git a/clang/www/c_dr_status.html b/clang/www/c_dr_status.html
index ea604b498a539..239e8e8140ba8 100644
--- a/clang/www/c_dr_status.html
+++ b/clang/www/c_dr_status.html
@@ -1242,13 +1242,13 @@ <h2 id="cdr">C defect report implementation status</h2>
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_218.htm">218</a></td>
     <td>C99</td>
     <td>Signs of non-numeric floating point values</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="219">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_219.htm">219</a></td>
     <td>NAD</td>
     <td>Effective types</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="220">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_220.htm">220</a></td>
@@ -1260,13 +1260,13 @@ <h2 id="cdr">C defect report implementation status</h2>
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_221.htm">221</a></td>
     <td>NAD</td>
     <td>Lacuna in pointer arithmetic</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="222">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_222.htm">222</a></td>
     <td>C99</td>
     <td>Partially initialized structures</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="223">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_223.htm">223</a></td>
@@ -1290,7 +1290,7 @@ <h2 id="cdr">C defect report implementation status</h2>
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_226.htm">226</a></td>
     <td>NAD</td>
     <td>strftime references</td>
-    <td class="full" align="center">Yes</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="227">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_227.htm">227</a></td>
@@ -1314,19 +1314,19 @@ <h2 id="cdr">C defect report implementation status</h2>
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_230.htm">230</a></td>
     <td>C99</td>
     <td>Enumerated type rank</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="231">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_231.htm">231</a></td>
     <td>NAD</td>
     <td>Semantics of text-line and non-directive</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr id="232">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_232.htm">232</a></td>
     <td>C99</td>
     <td>Typo in Annex I</td>
-    <td class="full" align="center">Yes</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="233">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_233.htm">233</a></td>


        


More information about the cfe-commits mailing list