[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-13 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr closed https://github.com/llvm/llvm-project/pull/143537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Hans Wennborg via cfe-commits
https://github.com/zmodem approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/143537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Hans Wennborg via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Hans Wennborg via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Hans Wennborg via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr updated https://github.com/llvm/llvm-project/pull/143537 >From 8ff6b6828604b25ded852adba37dd82e5cf7f771 Mon Sep 17 00:00:00 2001 From: Devon Loehr Date: Tue, 10 Jun 2025 13:57:06 + Subject: [PATCH 1/3] Enable UOD warning for windows --- clang/include/clang/Basic

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Hans Wennborg via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr updated https://github.com/llvm/llvm-project/pull/143537 >From 8ff6b6828604b25ded852adba37dd82e5cf7f771 Mon Sep 17 00:00:00 2001 From: Devon Loehr Date: Tue, 10 Jun 2025 13:57:06 + Subject: [PATCH 1/2] Enable UOD warning for windows --- clang/include/clang/Basic

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -825,13 +827,15 @@ The warning can be resolved by removing one of the conditions above. In rough order of preference, this may be done by: 1. Marking the object ``const`` (if possible) 2. Moving the object's definition to a source file -3. Giving the object non-hidden visib

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -806,7 +806,9 @@ def UniqueObjectDuplication : DiagGroup<"unique-object-duplication"> { Warns when objects which are supposed to be globally unique might get duplicated when built into a shared library. -If an object with hidden visibility is built into a shared library,

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
@@ -13518,8 +13518,29 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated( // If the object isn't hidden, the dynamic linker will prevent duplication. clang::LinkageInfo Lnk = Target->getLinkageAndVisibility(); - if (Lnk.getVisibility() != HiddenVisibility) +

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-11 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr updated https://github.com/llvm/llvm-project/pull/143537 >From 8ff6b6828604b25ded852adba37dd82e5cf7f771 Mon Sep 17 00:00:00 2001 From: Devon Loehr Date: Tue, 10 Jun 2025 13:57:06 + Subject: [PATCH 1/2] Enable UOD warning for windows --- clang/include/clang/Basic

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-10 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr created https://github.com/llvm/llvm-project/pull/143537 Followup to #125526. This expands the logic of the unique-object-duplication warning so that it also works for windows code. For the most part, the logic is unchanged, merely substituting "has no import/export

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-10 Thread Devon Loehr via cfe-commits
DKLoehr wrote: @zmodem, @nico https://github.com/llvm/llvm-project/pull/143537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Devon Loehr (DKLoehr) Changes Followup to #125526. This expands the logic of the unique-object-duplication warning so that it also works for windows code. For the most part, the logic is unchanged, merely substituting "has no import/expo