[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118687 >From 10985bcd5ae13f4533a9df4fa3035bd49e49af15 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 4 Dec 2024 14:31:48 -0500 Subject: [PATCH 1/4] [C++20] Deleting destructors can be noexcept Given a `n

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Richard Smith via cfe-commits
@@ -1206,15 +1206,16 @@ CanThrowResult Sema::canThrow(const Stmt *S) { CT = CT_Dependent; } else { const FunctionDecl *OperatorDelete = DE->getOperatorDelete(); - CT = canCalleeThrow(*this, DE, OperatorDelete); - if (const RecordType *RT = DTy->getAs()

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118687 >From 10985bcd5ae13f4533a9df4fa3035bd49e49af15 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 4 Dec 2024 14:31:48 -0500 Subject: [PATCH 1/3] [C++20] Deleting destructors can be noexcept Given a `n

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -Wno-unevaluated-expression -std=c++20 %s AaronBallman wrote: That test file has a lot of dynamic exception specification code in it, so it's leaning heavily on `-std=c++11`. https://g

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Aaron Ballman via cfe-commits
@@ -1206,15 +1206,16 @@ CanThrowResult Sema::canThrow(const Stmt *S) { CT = CT_Dependent; } else { const FunctionDecl *OperatorDelete = DE->getOperatorDelete(); - CT = canCalleeThrow(*this, DE, OperatorDelete); - if (const RecordType *RT = DTy->getAs()

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118687 >From 10985bcd5ae13f4533a9df4fa3035bd49e49af15 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 4 Dec 2024 14:31:48 -0500 Subject: [PATCH 1/2] [C++20] Deleting destructors can be noexcept Given a `n

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Aaron Ballman via cfe-commits
@@ -654,6 +654,9 @@ Bug Fixes in This Version - Fixed a crash when GNU statement expression contains invalid statement (#GH113468). - Fixed a failed assertion when using ``__attribute__((noderef))`` on an ``_Atomic``-qualified type (#GH116124). +- No longer return ``false``

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Richard Smith via cfe-commits
@@ -1205,11 +1205,12 @@ CanThrowResult Sema::canThrow(const Stmt *S) { if (DTy.isNull() || DTy->isDependentType()) { CT = CT_Dependent; } else { - CT = canCalleeThrow(*this, DE, DE->getOperatorDelete()); + const FunctionDecl *OperatorDelete = DE->getOper

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes Given a `noexcept` operator with an operand that calls `delete`, Clang was not considering whether the selected `operator delete` function was a destroying delete or not when inspecting whether the del

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Richard Smith via cfe-commits
@@ -654,6 +654,9 @@ Bug Fixes in This Version - Fixed a crash when GNU statement expression contains invalid statement (#GH113468). - Fixed a failed assertion when using ``__attribute__((noderef))`` on an ``_Atomic``-qualified type (#GH116124). +- No longer return ``false``

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -Wno-unevaluated-expression -std=c++20 %s shafik wrote: We already have https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp mayb

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/118687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/118687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/118687 Given a `noexcept` operator with an operand that calls `delete`, Clang was not considering whether the selected `operator delete` function was a destroying delete or not when inspecting whether the deleted