public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114013] New: [14 Regression] Specializations of var templates no longer emitted since r14-8987
@ 2024-02-20 16:35 jakub at gcc dot gnu.org
  2024-02-20 16:36 ` [Bug c++/114013] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-20 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114013
           Summary: [14 Regression] Specializations of var templates no
                    longer emitted since r14-8987
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

struct S { int a, b; };

template <int N>
constexpr struct S var[16] = {};

template <>
constexpr inline struct S var<6>[8] = {
  { 1, 1 }, { 2, 0 }, { 3, 1 }, { 4, 0 },
  { 5, 1 }, { 6, 0 }, { 7, 1 }, { 8, 0 }
};

[[gnu::noipa]] void
foo (S)
{
}

template <int N>
void
bar (int x)
{
  foo (var<N>[x]);
}

volatile int x;

int
main ()
{
  bar <6> (x);
}

extracted from mesa no longer links starting with
r14-8987-gdd9d14f7d53de07beff06004922a2bff20ece671 (-O0 or -O2, doesn't
matter).
/usr/bin/ld: /tmp/cc4Mqq20.o: in function `void bar<6>(int)':
mesa.C:(.text._Z3barILi6EEvi[_Z3barILi6EEvi]+0x14): undefined reference to
`var<6>'
collect2: error: ld returned 1 exit status

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

end of thread, other threads:[~2024-02-28 10:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 16:35 [Bug c++/114013] New: [14 Regression] Specializations of var templates no longer emitted since r14-8987 jakub at gcc dot gnu.org
2024-02-20 16:36 ` [Bug c++/114013] " jakub at gcc dot gnu.org
2024-02-20 17:53 ` jakub at gcc dot gnu.org
2024-02-20 17:54 ` jakub at gcc dot gnu.org
2024-02-27 16:44 ` enrico.seiler+gccbugs at outlook dot com
2024-02-28  0:26 ` cvs-commit at gcc dot gnu.org
2024-02-28 10:17 ` jakub 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).