public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/99914] New: d: Template symbols not overridable by normal symbols
@ 2021-04-05 11:07 ibuclaw at gdcproject dot org
  2021-04-05 11:41 ` [Bug d/99914] " cvs-commit at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-04-05 11:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99914

            Bug ID: 99914
           Summary: d: Template symbols not overridable by normal symbols
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

Currently, the following does not link:

 extern(C) __gshared bool rt_cmdline_enabled = false;

Because the symbol conflicts with a template symbol of the same name in the D
runtime library.

 template rt_cmdline_enabled()
 {
     pragma(mangle, "rt_cmdline_enabled")
     __gshared bool rt_cmdline_enabled = true;
 }

Template symbols are made DECL_ONE_ONLY, which ends up in the gnu.linkonce
section as a unique global symbol.  However, the linker only considers other
symbols in gnu.linkonce as being candidates for discarding duplicates.

The expected and correct behaviour is for all instantiations to be declared
weak.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-17 12:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 11:07 [Bug d/99914] New: d: Template symbols not overridable by normal symbols ibuclaw at gdcproject dot org
2021-04-05 11:41 ` [Bug d/99914] " cvs-commit at gcc dot gnu.org
2021-04-05 11:53 ` ibuclaw at gdcproject dot org
2021-04-14 12:44 ` cvs-commit at gcc dot gnu.org
2021-04-14 13:02 ` ibuclaw at gdcproject dot org
2021-04-17 12:37 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).