https://github.com/DKLoehr created
https://github.com/llvm/llvm-project/pull/142158
This improves the documentation for the unique-object-duplication warning. It
clarifies the conditions for the warning to fire, provides clearer instructions
on how to resolve it, and adjusts wording to be more
@@ -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)
+
@@ -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)
+
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
@@ -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)
+
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
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
@@ -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)
+
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
@@ -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,
@@ -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
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
@@ -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)
+
https://github.com/DKLoehr closed
https://github.com/llvm/llvm-project/pull/145944
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 114 of 114 matches
Mail list logo