Skip to content

Commit 326657f

Browse files
authored
[Clang] Address post commit feedbacks in #89906 (#90495)
* Fix a leak * Fix a maybe unused warning * Fix incorrect cxx_status entry
1 parent 359ab3a commit 326657f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clang/include/clang/Sema/DeclSpec.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,15 +1811,15 @@ class DecompositionDeclarator {
18111811
: Bindings(nullptr), NumBindings(0), DeleteBindings(false) {}
18121812
DecompositionDeclarator(const DecompositionDeclarator &G) = delete;
18131813
DecompositionDeclarator &operator=(const DecompositionDeclarator &G) = delete;
1814-
~DecompositionDeclarator() {
1815-
if (DeleteBindings)
1816-
delete[] Bindings;
1817-
}
1814+
~DecompositionDeclarator() { clear(); }
18181815

18191816
void clear() {
18201817
LSquareLoc = RSquareLoc = SourceLocation();
18211818
if (DeleteBindings)
18221819
delete[] Bindings;
1820+
else
1821+
llvm::for_each(llvm::MutableArrayRef(Bindings, NumBindings),
1822+
[](Binding &B) { B.Attrs.reset(); });
18231823
Bindings = nullptr;
18241824
NumBindings = 0;
18251825
DeleteBindings = false;

clang/lib/AST/DeclBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ int64_t Decl::getID() const {
11151115

11161116
const FunctionType *Decl::getFunctionType(bool BlocksToo) const {
11171117
QualType Ty;
1118-
if (const auto *D = dyn_cast<BindingDecl>(this))
1118+
if (isa<BindingDecl>(this))
11191119
return nullptr;
11201120
else if (const auto *D = dyn_cast<ValueDecl>(this))
11211121
Ty = D->getType();

clang/www/cxx_status.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h2 id="cxx26">C++2c implementation status</h2>
177177
<tr>
178178
<td>Attributes for Structured Bindings</td>
179179
<td><a href="https://wg21.link/P0609R3">P0609R3</a></td>
180-
<td class="none" align="center">No</td>
180+
<td class="none" align="center">Clang 19</td>
181181
</tr>
182182
<tr>
183183
<td>Module Declarations Shouldn’t be Macros</td>
@@ -187,7 +187,7 @@ <h2 id="cxx26">C++2c implementation status</h2>
187187
<tr>
188188
<td>Trivial infinite loops are not Undefined Behavior</td>
189189
<td><a href="https://wg21.link/P2809R3">P2809R3</a> (<a href="#dr">DR</a>)</td>
190-
<td class="unreleased" align="center">Clang 19</td>
190+
<td class="unreleased" align="center">No</td>
191191
</tr>
192192
<tr>
193193
<td>Erroneous behaviour for uninitialized reads</td>

0 commit comments

Comments
 (0)