From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF66F385801C; Tue, 22 Feb 2022 09:10:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF66F385801C From: "max.sagebaum at scicomp dot uni-kl.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104631] Visibility of static member s yields duplicate symbols. Date: Tue, 22 Feb 2022 09:10:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: max.sagebaum at scicomp dot uni-kl.de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2022 09:10:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104631 --- Comment #2 from Max S. --- Ok, thank you for the answer. In the example I can set this for the class b= ut, in the library it would be problematic. So here the best solution would be = to set the whole library to default. Since the user should decide how the visibility of the library is, we do not want to set it to default. Since after all, our library could only be used = in a library of the user and other programs never need to see it. But we would like to warn the user if our library is included with visibili= ty hidden.=20 Is there a preprocessor macro that can provide this information?=20 Or is it possible to detect the visibility of a type during compile time in order to trigger a static assert? Thanks.=