[clang] [analyzer] Do not destruct fields of unions (PR #122330)

2025-02-04 Thread Jameson Nash via cfe-commits
https://github.com/vtjnash updated https://github.com/llvm/llvm-project/pull/122330 >From 0293a835a395c2e5a54efd16b70a38e73f116c59 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 9 Jan 2025 17:10:08 + Subject: [PATCH 1/3] [Sema] do not destruct fields of unions The C++ standard proh

[clang] [analyzer] Do not destruct fields of unions (PR #122330)

2025-02-04 Thread Jameson Nash via cfe-commits
@@ -441,3 +441,31 @@ void testLeakBecauseNTTPIsNotDeallocation() { void* p = ::operator new(10); deallocate_via_nttp(p); } // leak-warning{{Potential leak of memory pointed to by 'p'}} + +namespace optional_union { + template + class unique_ptr { +T *q; + public: +

[clang] [analyzer] Do not destruct fields of unions (PR #122330)

2025-02-03 Thread Jameson Nash via cfe-commits
@@ -377,3 +377,27 @@ void directUnknownSymbol() { } } + +void testUnionDtor() { + static int unionDtorCalled; + InlineDtor::cnt = 0; + InlineDtor::dtorCalled = 0; + unionDtorCalled = 0; + { + union UnionDtor { + InlineDtor kind1; + char kind2; +

[clang] [analyzer] Do not destruct fields of unions (PR #122330)

2025-02-03 Thread Jameson Nash via cfe-commits
https://github.com/vtjnash updated https://github.com/llvm/llvm-project/pull/122330 >From 829e1c89ce869f782cb802a1d618003770c0d074 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 9 Jan 2025 17:10:08 + Subject: [PATCH 1/3] [Sema] do not destruct fields of unions The C++ standard proh

[clang] [Sema] do not destruct fields of unions (PR #122330)

2025-01-29 Thread Jameson Nash via cfe-commits
https://github.com/vtjnash updated https://github.com/llvm/llvm-project/pull/122330 >From 829e1c89ce869f782cb802a1d618003770c0d074 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 9 Jan 2025 17:10:08 + Subject: [PATCH 1/2] [Sema] do not destruct fields of unions The C++ standard proh

[clang] [Sema] do not destruct fields of unions (PR #122330)

2025-01-16 Thread Jameson Nash via cfe-commits
vtjnash wrote: This roughly corresponds to 921bd20dddf5080cdb36f39c0162eb63b2d5325e in Sema, I think (@zygoloid). Maybe @tkremenek or @yronglin has done something in this part of the code recently too as reviewers and to merge this? https://github.com/llvm/llvm-project/pull/122330

[clang] [Sema] do not destruct fields of unions (PR #122330)

2025-01-09 Thread Jameson Nash via cfe-commits
https://github.com/vtjnash created https://github.com/llvm/llvm-project/pull/122330 The C++ standard prohibits this implicit destructor call, leading to incorrect reports from clang-analyzer. This causes projects that use std::option (including llvm) to fail the cplusplus.NewDelete test incorr

[clang-tools-extra] [clang-tidy] Enable plugin tests with LLVM_INSTALL_TOOLCHAIN_ONLY (PR #90370)

2024-04-27 Thread Jameson Nash via cfe-commits
vtjnash wrote: I think out of tree builds of clang-tidy (back in the svn days, when people did partial checkouts of individual projects) probably needed this to be able to correctly correctly find the right headers. Maybe standalone builds aren't permitted anymore? I think I mentioned this a b

[clang] 9d59cfc - clang-analyzer plugins require LLVM_ENABLE_PLUGINS also

2022-02-16 Thread Jameson Nash via cfe-commits
Author: Jameson Nash Date: 2022-02-16T11:59:09-05:00 New Revision: 9d59cfc67eadbe4b4088d70f8bbc61c96568d2f1 URL: https://github.com/llvm/llvm-project/commit/9d59cfc67eadbe4b4088d70f8bbc61c96568d2f1 DIFF: https://github.com/llvm/llvm-project/commit/9d59cfc67eadbe4b4088d70f8bbc61c96568d2f1.diff

[clang] 76cad51 - replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests

2022-02-09 Thread Jameson Nash via cfe-commits
Author: Jameson Nash Date: 2022-02-09T17:31:34-05:00 New Revision: 76cad51ba700233d6e3492eddcbb466b6adbc2eb URL: https://github.com/llvm/llvm-project/commit/76cad51ba700233d6e3492eddcbb466b6adbc2eb DIFF: https://github.com/llvm/llvm-project/commit/76cad51ba700233d6e3492eddcbb466b6adbc2eb.diff

[clang-tools-extra] 84f137a - Reland "enable plugins for clang-tidy"

2022-02-01 Thread Jameson Nash via cfe-commits
Author: Jameson Nash Date: 2022-02-01T17:37:24-05:00 New Revision: 84f137a590e7de25c4105303e5938c40566c2dfb URL: https://github.com/llvm/llvm-project/commit/84f137a590e7de25c4105303e5938c40566c2dfb DIFF: https://github.com/llvm/llvm-project/commit/84f137a590e7de25c4105303e5938c40566c2dfb.diff

[clang-tools-extra] 3689272 - enable plugins for clang-tidy

2022-01-29 Thread Jameson Nash via cfe-commits
Author: Jameson Nash Date: 2022-01-29T14:21:19-05:00 New Revision: 36892727e4f19a60778e371d78f8fb09d8122c85 URL: https://github.com/llvm/llvm-project/commit/36892727e4f19a60778e371d78f8fb09d8122c85 DIFF: https://github.com/llvm/llvm-project/commit/36892727e4f19a60778e371d78f8fb09d8122c85.diff