[clang] 326657f - [Clang] Address post commit feedbacks in #89906 (#90495)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 29 13:11:15 PDT 2024
Author: cor3ntin
Date: 2024-04-29T22:11:09+02:00
New Revision: 326657f5679889e3374354ba3243e27bda2080f4
URL: https://github.com/llvm/llvm-project/commit/326657f5679889e3374354ba3243e27bda2080f4
DIFF: https://github.com/llvm/llvm-project/commit/326657f5679889e3374354ba3243e27bda2080f4.diff
LOG: [Clang] Address post commit feedbacks in #89906 (#90495)
* Fix a leak
* Fix a maybe unused warning
* Fix incorrect cxx_status entry
Added:
Modified:
clang/include/clang/Sema/DeclSpec.h
clang/lib/AST/DeclBase.cpp
clang/www/cxx_status.html
Removed:
################################################################################
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index 760c7980be52bd..23bc780e04979d 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -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;
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index f341c74cf86e37..03e1055251c24f 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -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();
diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html
index d58c35b72c22bb..0996abc2405857 100755
--- a/clang/www/cxx_status.html
+++ b/clang/www/cxx_status.html
@@ -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>
@@ -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>
More information about the cfe-commits
mailing list