Skip to content

[Clang] Address post commit feedbacks in #89906 #90495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

cor3ntin
Copy link
Contributor

  • Fix a leak
  • Fix a maybe unused warning
  • Fix incorrect cxx_status entry

@cor3ntin cor3ntin requested a review from erichkeane April 29, 2024 16:53
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Apr 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 29, 2024

@llvm/pr-subscribers-clang

Author: cor3ntin (cor3ntin)

Changes
  • Fix a leak
  • Fix a maybe unused warning
  • Fix incorrect cxx_status entry

Full diff: https://github.com/llvm/llvm-project/pull/90495.diff

3 Files Affected:

  • (modified) clang/include/clang/Sema/DeclSpec.h (+3)
  • (modified) clang/lib/AST/DeclBase.cpp (+1-1)
  • (modified) clang/www/cxx_status.html (+2-2)
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index 760c7980be52bd..d641e7c3b92d5e 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -1814,6 +1814,9 @@ class DecompositionDeclarator {
   ~DecompositionDeclarator() {
     if (DeleteBindings)
       delete[] Bindings;
+    else
+      llvm::for_each(llvm::MutableArrayRef(Bindings, NumBindings),
+                     [](Binding &B) { B.Attrs.reset(); });
   }
 
   void clear() {
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>

* Fix a leak
* Fix a maybe unused warning
* Fix incorrect cxx_status entry
@cor3ntin cor3ntin force-pushed the corentin/fix_stuctured_binding branch from 9d29106 to bc23126 Compare April 29, 2024 17:52
@cor3ntin cor3ntin merged commit 326657f into llvm:main Apr 29, 2024
3 of 4 checks passed
@cor3ntin
Copy link
Contributor Author

This compiles locally. CI is really slow...

@@ -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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unreleased -> none

@@ -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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none -> unreleased

But maybe just fix this together when landing #90066...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, how did that happen? Thanks for noticing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants