Skip to content

Commit d231e3b

Browse files
committed
[C11] Add test & update status of N1282 and DR087
Our existing diagnostics for catching unsequenced modifications handles test coverage for N1282, which is correcting the standard based on the resolution of DR087.
1 parent 46b853a commit d231e3b

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

clang/test/C/C11/n1282.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %clang_cc1 -verify -Wunsequenced -Wno-unused-value %s
2+
3+
/* WG14 N1282: Yes
4+
* Clarification of Expressions
5+
*/
6+
7+
int g;
8+
9+
int f(int i) {
10+
g = i;
11+
return 0;
12+
}
13+
14+
int main(void) {
15+
int x;
16+
x = (10, g = 1, 20) + (30, g = 2, 40); /* Line A */ // expected-warning {{multiple unsequenced modifications to 'g'}}
17+
x = (10, f(1), 20) + (30, f(2), 40); /* Line B */
18+
x = (g = 1) + (g = 2); /* Line C */ // expected-warning {{multiple unsequenced modifications to 'g'}}
19+
return 0;
20+
}

clang/test/C/drs/dr0xx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
* WG14 DR085: yes
7474
* Returning from main
7575
*
76+
* WG14 DR087: yes
77+
* Order of evaluation
78+
* Note: this DR is covered by C/C11/n1282.c
79+
*
7680
* WG14 DR086: yes
7781
* Object-like macros in system headers
7882
*

clang/www/c_dr_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h2 id="cdr">C defect report implementation status</h2>
577577
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_087.html">87</a></td>
578578
<td>NAD</td>
579579
<td>Order of evaluation</td>
580-
<td class="unknown" align="center">Unknown</td>
580+
<td class="full" align="center">Yes</td>
581581
</tr>
582582
<tr id="88">
583583
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_088.html">88</a></td>

clang/www/c_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ <h2 id="c11">C11 implementation status</h2>
401401
<tr>
402402
<td>Clarification of expressions</td>
403403
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1282.pdf">N1282</a></td>
404-
<td class="unknown" align="center">Unknown</td>
404+
<td class="full" align="center">Yes</td>
405405
</tr>
406406
<tr>
407407
<td>Extending the lifetime of temporary objects (factored approach)</td>

0 commit comments

Comments
 (0)