From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 945EC3858D33; Tue, 20 Feb 2024 16:35:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 945EC3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708446915; bh=i2PmwszaJmYUqhpcTTPkH4MJKAnDjVLFmVbAe5OG5aA=; h=From:To:Subject:Date:From; b=ovEMJ0Hvy/P0zPg9XICvDaldivP00SWBqYgFrUqQxI0wW7QLDoIY3TaYVEjg+kPVz OgVIg25Mg26+0RxjmNW5DY4fI0miguVou3dBjsREmF96dtq09VtLkUGBzOCbKEMmiJ RiuGjoQLsR/Z1fA4oa4id93V2XOCLuWS/lm+q+jc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114013] New: [14 Regression] Specializations of var templates no longer emitted since r14-8987 Date: Tue, 20 Feb 2024 16:35:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114013 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 constexpr struct S var[16] =3D {}; template <> constexpr inline struct S var<6>[8] =3D { { 1, 1 }, { 2, 0 }, { 3, 1 }, { 4, 0 }, { 5, 1 }, { 6, 0 }, { 7, 1 }, { 8, 0 } }; [[gnu::noipa]] void foo (S) { } template void bar (int x) { foo (var[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=