Skip to content

Commit

Permalink
[clang] Add test for CWG1341 (#67965)
Browse files Browse the repository at this point in the history
  • Loading branch information
Endilll committed Oct 2, 2023
1 parent a41ce98 commit 0e87f6f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions clang/test/CXX/drs/dr13xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,23 @@ namespace dr1330 { // dr1330: 4 c++11
#endif
}

namespace dr1341 { // dr1341: sup P0683R1
#if __cplusplus >= 202002L
int a;
const int b = 0; // #dr1341-b-decl
struct S {
int x1 : 8 = 42;
int x2 : 8 { 42 };
int y1 : true ? 8 : a = 42;
int y2 : true ? 8 : b = 42;
// expected-error@-1 {{cannot assign to variable 'b' with const-qualified type 'const int'}}
// expected-note@#dr1341-b-decl {{variable 'b' declared const here}}
int y3 : (true ? 8 : b) = 42;
int z : 1 || new int { 0 };
};
#endif
}

namespace dr1346 { // dr1346: 3.5
auto a(1); // expected-error 0-1{{extension}}
auto b(1, 2); // expected-error {{multiple expressions}} expected-error 0-1{{extension}}
Expand Down
2 changes: 1 addition & 1 deletion clang/www/cxx_dr_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -7853,7 +7853,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="https://cplusplus.github.io/CWG/issues/1341.html">1341</a></td>
<td>NAD</td>
<td>Bit-field initializers</td>
<td class="none" align="center">Unknown</td>
<td class="na" align="center">Superseded by <a href="https://wg21.link/P0683R1">P0683R1</a></td>
</tr>
<tr id="1342">
<td><a href="https://cplusplus.github.io/CWG/issues/1342.html">1342</a></td>
Expand Down

0 comments on commit 0e87f6f

Please sign in to comment.