Skip to content

Commit

Permalink
[Clang] Address post commit feedback in llvm#89906
Browse files Browse the repository at this point in the history
* Fix a leak
* Fix a maybe unused warning
* Fix incorrect cxx_status entry
  • Loading branch information
cor3ntin committed Apr 29, 2024
1 parent 6f02120 commit bc23126
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions clang/include/clang/Sema/DeclSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -1811,15 +1811,15 @@ class DecompositionDeclarator {
: Bindings(nullptr), NumBindings(0), DeleteBindings(false) {}
DecompositionDeclarator(const DecompositionDeclarator &G) = delete;
DecompositionDeclarator &operator=(const DecompositionDeclarator &G) = delete;
~DecompositionDeclarator() {
if (DeleteBindings)
delete[] Bindings;
}
~DecompositionDeclarator() { clear(); }

void clear() {
LSquareLoc = RSquareLoc = SourceLocation();
if (DeleteBindings)
delete[] Bindings;
else
llvm::for_each(llvm::MutableArrayRef(Bindings, NumBindings),
[](Binding &B) { B.Attrs.reset(); });
Bindings = nullptr;
NumBindings = 0;
DeleteBindings = false;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/DeclBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ int64_t Decl::getID() const {

const FunctionType *Decl::getFunctionType(bool BlocksToo) const {
QualType Ty;
if (const auto *D = dyn_cast<BindingDecl>(this))
if (isa<BindingDecl>(this))
return nullptr;
else if (const auto *D = dyn_cast<ValueDecl>(this))
Ty = D->getType();
Expand Down
4 changes: 2 additions & 2 deletions clang/www/cxx_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ <h2 id="cxx26">C++2c implementation status</h2>
<tr>
<td>Attributes for Structured Bindings</td>
<td><a href="https://wg21.link/P0609R3">P0609R3</a></td>
<td class="none" align="center">No</td>
<td class="none" align="center">Clang 19</td>
</tr>
<tr>
<td>Module Declarations Shouldn’t be Macros</td>
Expand All @@ -187,7 +187,7 @@ <h2 id="cxx26">C++2c implementation status</h2>
<tr>
<td>Trivial infinite loops are not Undefined Behavior</td>
<td><a href="https://wg21.link/P2809R3">P2809R3</a> (<a href="#dr">DR</a>)</td>
<td class="unreleased" align="center">Clang 19</td>
<td class="unreleased" align="center">No</td>
</tr>
<tr>
<td>Erroneous behaviour for uninitialized reads</td>
Expand Down

0 comments on commit bc23126

Please sign in to comment.