Skip to content

Commit 86946eb

Browse files
committed
[clang] Add test for CWG1822
[[https://wg21.link/p1787 | P1787]]: CWG1822 is resolved by specifying that the body of a lambda remains in the surrounding (function parameter) scope. Wording: A parameter-declaration-clause P introduces a function parameter scope that includes P. <...> If P is associated with a lambda-declarator, its scope extends to the end of the compound-statement in the lambda-expression. ([basic.scope.param]) Reviewed By: #clang-language-wg, shafik Differential Revision: https://reviews.llvm.org/D147836
1 parent 03dcd9d commit 86946eb

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

clang/test/CXX/drs/dr18xx.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ namespace dr1815 { // dr1815: no
5050
#endif
5151
}
5252

53+
namespace dr1822 { // dr1822: yes
54+
#if __cplusplus >= 201103L
55+
int a;
56+
auto x = [] (int a) {
57+
#pragma clang __debug dump a // CHECK: ParmVarDecl
58+
};
59+
#endif
60+
}
61+
5362
namespace dr1872 { // dr1872: 9
5463
#if __cplusplus >= 201103L
5564
template<typename T> struct A : T {

clang/www/cxx_dr_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10739,7 +10739,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1073910739
<td><a href="https://wg21.link/cwg1822">1822</a></td>
1074010740
<td>CD6</td>
1074110741
<td>Lookup of parameter names in <I>lambda-expression</I>s</td>
10742-
<td class="none" align="center">Unknown</td>
10742+
<td class="full" align="center">Yes</td>
1074310743
</tr>
1074410744
<tr id="1823">
1074510745
<td><a href="https://wg21.link/cwg1823">1823</a></td>

0 commit comments

Comments
 (0)