[clang] b63b4d8 - Add tests & update the C99 DR statuses for dr315 and dr316
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 21 12:33:14 PDT 2022
Author: Aaron Ballman
Date: 2022-09-21T15:33:03-04:00
New Revision: b63b4d89663c240a77675d233652dcc854a85bb7
URL: https://github.com/llvm/llvm-project/commit/b63b4d89663c240a77675d233652dcc854a85bb7
DIFF: https://github.com/llvm/llvm-project/commit/b63b4d89663c240a77675d233652dcc854a85bb7.diff
LOG: Add tests & update the C99 DR statuses for dr315 and dr316
Added:
Modified:
clang/test/C/drs/dr3xx.c
clang/www/c_dr_status.html
Removed:
################################################################################
diff --git a/clang/test/C/drs/dr3xx.c b/clang/test/C/drs/dr3xx.c
index de25c4d5e35bc..795bc590f5351 100644
--- a/clang/test/C/drs/dr3xx.c
+++ b/clang/test/C/drs/dr3xx.c
@@ -1,4 +1,4 @@
-/* RUN: %clang_cc1 -std=c89 -fsyntax-only -Wvla -verify -pedantic -Wno-c11-extensions %s
+/* RUN: %clang_cc1 -std=c89 -fsyntax-only -Wvla -verify=expected,c89only -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
@@ -83,7 +83,7 @@ void dr311(int x) {
vla y[3]; /* expected-warning {{variable length array}} */
}
-/* WG14 DR313:
+/* WG14 DR313: yes
* Incomplete arrays of VLAs
*/
void dr313(int i) {
@@ -91,3 +91,27 @@ void dr313(int i) {
expected-warning {{variable length array}}
*/
}
+
+/* WG14 DR315: yes
+ * Implementation-defined bit-field types
+ */
+struct dr315_t {
+ unsigned long long a : 37; /* c89only-warning {{'long long' is an extension when C99 mode is not enabled}} */
+ unsigned long long b : 37; /* c89only-warning {{'long long' is an extension when C99 mode is not enabled}} */
+
+ short c : 8;
+ short d : 8;
+} dr315;
+_Static_assert(sizeof(dr315.a + dr315.b) == sizeof(unsigned long long), ""); /* c89only-warning {{'long long' is an extension when C99 mode is not enabled}} */
+/* Demonstrate that integer promotions still happen when less than the width of
+ * an int.
+ */
+_Static_assert(sizeof(dr315.c + dr315.d) == sizeof(int), "");
+
+/* WG14 DR316: yes
+ * Unprototyped function types
+ */
+#if __STDC_VERSION__ < 202000L
+void dr316_1(a) int a; {} /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+void (*dr316_1_ptr)(int, int, int) = dr316_1;
+#endif /* __STDC_VERSION__ < 202000L */
diff --git a/clang/www/c_dr_status.html b/clang/www/c_dr_status.html
index 3d0a64b731500..4ef2937e7fe0f 100644
--- a/clang/www/c_dr_status.html
+++ b/clang/www/c_dr_status.html
@@ -1843,13 +1843,13 @@ <h2 id="cdr">C defect report implementation status</h2>
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_315.htm">315</a></td>
<td>C99</td>
<td>Implementation-defined bit-field types</td>
- <td class="unknown" align="center">Unknown</td>
+ <td class="full" align="center">Yes</td>
</tr>
<tr id="316">
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_316.htm">316</a></td>
<td>NAD</td>
<td>Unprototyped function types</td>
- <td class="unknown" align="center">Unknown</td>
+ <td class="full" align="center">Yes</td>
</tr>
<tr id="317">
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_317.htm">317</a></td>
More information about the cfe-commits
mailing list