[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/95718 Used to implement CWG2191 where `typeid` for a polymorphic glvalue only becomes potentially-throwing if the `typeid` operand was already potentially throwing or a `nullptr` check was inserted: https://cplusp

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Mital Ashok (MitalAshok) Changes Used to implement CWG2191 where `typeid` for a polymorphic glvalue only becomes potentially-throwing if the `typeid` operand was already potentially throwing or a `nullpt

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: You need to run `clang/www/make_cxx_dr_status` script. https://github.com/llvm/llvm-project/pull/95718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95718 >From fc28e8f9b987ca35db457afaf19fa8c2af2f9574 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 16 Jun 2024 20:27:15 +0100 Subject: [PATCH 1/3] [Clang] Introduce CXXTypeidExpr::hasNullCheck --- clang/do

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: If you update the branch, you should be able to get rid of unrelated changes to `cxx_dr_status.html`. https://github.com/llvm/llvm-project/pull/95718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95718 >From fc28e8f9b987ca35db457afaf19fa8c2af2f9574 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 16 Jun 2024 20:27:15 +0100 Subject: [PATCH 1/4] [Clang] Introduce CXXTypeidExpr::hasNullCheck --- clang/do

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
@@ -268,6 +268,9 @@ Resolutions to C++ Defect Reports - Clang now requires a template argument list after a template keyword. (`CWG96: Syntactic disambiguation using the template keyword `_). +- Clang no longer always reports

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
@@ -15598,7 +15598,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/2632.html";>2632 -review +drafting Endilll wrote: Update you branch with the latest `main` changes, and those unrelated changes will go a

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. DR test looks good, but wait for more approvals. https://github.com/llvm/llvm-project/pull/95718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/95718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95718 >From c3912611dd63f81ea7067a4b26ef5450f6f01f75 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 16 Jun 2024 22:35:38 +0100 Subject: [PATCH] [Clang] Introduce CXXTypeidExpr::hasNullCheck --- clang/docs/R

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/95718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95718 >From c3912611dd63f81ea7067a4b26ef5450f6f01f75 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 16 Jun 2024 22:35:38 +0100 Subject: [PATCH 1/2] [Clang] Introduce CXXTypeidExpr::hasNullCheck --- clang/do

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

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

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

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

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-17 Thread via cfe-commits
@@ -166,6 +166,55 @@ QualType CXXTypeidExpr::getTypeOperand(ASTContext &Context) const { Operand.get()->getType().getNonReferenceType(), Quals); } +namespace { +static bool isGLValueFromPointerDeref(const Expr *E) { Sirraide wrote: Pretty sure `namespa

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95718 >From c3912611dd63f81ea7067a4b26ef5450f6f01f75 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 16 Jun 2024 22:35:38 +0100 Subject: [PATCH 1/3] [Clang] Introduce CXXTypeidExpr::hasNullCheck --- clang/do

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

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