public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error
@ 2024-06-18 23:06 nikhilg1 at uci dot edu
  2024-06-18 23:11 ` [Bug c++/115546] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nikhilg1 at uci dot edu @ 2024-06-18 23:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115546
           Summary: [14.1.0 Regression] Section Type Conflict Error
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nikhilg1 at uci dot edu
  Target Milestone: ---

Consider the following reduced test case:

$>cat test.cpp
template <class T>
int v2 __attribute__((section("A"))) = sizeof(T);

template <>
int v2<double> __attribute__((section("A"))) = 50;

void a(int*& x) {
  x = &v2<int>;
}

$>g++-13 -c test.cpp && echo OK
OK

$>g++-14 -c test.cpp && echo OK
test.cpp:2:5: error: 'v2<int>' causes a section type conflict with 'v2<double>'
    2 | int v2 __attribute__((section("A"))) = sizeof(T);
      |     ^~
test.cpp:5:5: note: 'v2<double>' was declared here
    5 | int v2<double> __attribute__((section("A"))) = 50;
      |     ^~~~~~~~~~

$>clang++-17 -c test.cpp && echo OK
OK


I am looking through the docs on the section attribute
(https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Common-Variable-Attributes.html)
but am not able to see any reason why this case has started to fail. I also
don't see any other compiler failing for this case.

Issue is occurring since g++ 14.1.0 and seems to be reproducible on trunk as
well.

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

end of thread, other threads:[~2024-06-18 23:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18 23:06 [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error nikhilg1 at uci dot edu
2024-06-18 23:11 ` [Bug c++/115546] " pinskia at gcc dot gnu.org
2024-06-18 23:13 ` pinskia at gcc dot gnu.org
2024-06-18 23:15 ` pinskia at gcc dot gnu.org
2024-06-18 23:17 ` pinskia 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).