[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/95846 3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f changed it so that not all potentially-evaluated `typeid`s were marked as potentially-throwing, but I forgot to check the subexpression if the null check of the `typei

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mital Ashok (MitalAshok) Changes 3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f changed it so that not all potentially-evaluated `typeid`s were marked as potentially-throwing, but I forgot to check the subexpression if the null check of the `ty

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Mital Ashok via cfe-commits
MitalAshok wrote: CC @Endilll @Sirraide https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Timm Baeder via cfe-commits
@@ -,13 +,18 @@ static CanThrowResult canDynamicCastThrow(const CXXDynamicCastExpr *DC) { } static CanThrowResult canTypeidThrow(Sema &S, const CXXTypeidExpr *DC) { - if (DC->isTypeOperand()) + // Operand is not evaluated, cannot possibly throw tbae

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Timm Baeder via cfe-commits
@@ -,13 +,18 @@ static CanThrowResult canDynamicCastThrow(const CXXDynamicCastExpr *DC) { } static CanThrowResult canTypeidThrow(Sema &S, const CXXTypeidExpr *DC) { - if (DC->isTypeOperand()) + // Operand is not evaluated, cannot possibly throw + if (!DC->isPotenti

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95846 >From 89da8b3bcc678430fe4225c723e87914f2c378cd Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 17 Jun 2024 21:48:57 +0100 Subject: [PATCH 1/2] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throw

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95846 >From 89da8b3bcc678430fe4225c723e87914f2c378cd Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 17 Jun 2024 21:48:57 +0100 Subject: [PATCH 1/3] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throw

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-18 Thread via cfe-commits
Sirraide wrote: Do we already have tests for your most recent commit (i.e. dependent expressions)? Because I recall CI passing even when that wasn’t there, but that may have been my imagination. https://github.com/llvm/llvm-project/pull/95846 ___ cfe

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95846 >From 89da8b3bcc678430fe4225c723e87914f2c378cd Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 17 Jun 2024 21:48:57 +0100 Subject: [PATCH 1/4] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throw

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Sirraide Yes, the tests did pass because there were no tests for this. For reference: * `llvm:main` currently only handles these two wrong https://github.com/llvm/llvm-project/pull/95846/commits/89da8b3bcc678430fe4225c723e87914f2c378cd#diff-c35ff1c0977223e8ef2893fd21f3886c57

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
@@ -115,3 +116,39 @@ static_assert(!noexcept(typeid((Polymorphic&&) Polymorphic&) Polymorphic{}))); static_assert(!noexcept(typeid(*&(const Polymorphic&) Polymorphic{}))); static_assert(!noexcept(typeid(*&(const Polymorphic&) Polymorphic{}))); + +template +struct X { + templ

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. Alright, this does look like we’re handling all cases now (that I can think of at least). However, I’d like to see some comments added to `f1`–`f3`, indicating why they’re dependent, because it took me a bit of thinking to figure that out

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95846 >From 89da8b3bcc678430fe4225c723e87914f2c378cd Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 17 Jun 2024 21:48:57 +0100 Subject: [PATCH 1/5] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throw

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. Thanks, the comments are pretty much exactly what I had in mind. https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-20 Thread via cfe-commits
Sirraide wrote: In case anyone ends up being confused by the lack of a release note here: #95718 already added one that still covers everything done in this pr seeing as this is mostly a follow-up to that one. https://github.com/llvm/llvm-project/pull/95846

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-20 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits