public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106633] New: Hidden visibility on forward declarations impacts visibility of default-visibility class methods
@ 2022-08-15 23:44 mh+gcc at glandium dot org
  2022-08-15 23:50 ` [Bug c++/106633] " pinskia at gcc dot gnu.org
  2022-08-16  1:05 ` mh+gcc at glandium dot org
  0 siblings, 2 replies; 3+ messages in thread
From: mh+gcc at glandium dot org @ 2022-08-15 23:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106633
           Summary: Hidden visibility on forward declarations impacts
                    visibility of default-visibility class methods
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mh+gcc at glandium dot org
  Target Milestone: ---

This was not happening before GCC 12.

Reduced testcase from a Firefox build failure we got in Debian on armhf:

```
#pragma GCC visibility push(hidden)
namespace std { class type_info; }
#pragma GCC visibility pop
#include <typeinfo>
bool foo(std::type_info& a, std::type_info& b) { return a == b; }
```

Compile with `-O2 -D__GXX_TYPEINFO_EQUALITY_INLINE=0` (the define makes the
problem appear on all platforms, rather than armhf only)

What happens in this example is that the symbol reference to
`std::type_info::operator==` ends up with hidden visibility, instead of default
visibility. With GCC 11 and older versions, it would end up with default
visibility.

On godbolt:
https://godbolt.org/z/hYKjWGaeq

(Ironically(?), that forward declaration comes from ICU working around an old
bug in libstdc++ headers)

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

* [Bug c++/106633] Hidden visibility on forward declarations impacts visibility of default-visibility class methods
  2022-08-15 23:44 [Bug c++/106633] New: Hidden visibility on forward declarations impacts visibility of default-visibility class methods mh+gcc at glandium dot org
@ 2022-08-15 23:50 ` pinskia at gcc dot gnu.org
  2022-08-16  1:05 ` mh+gcc at glandium dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-15 23:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't think this is a gcc bug but rather gcc 12 fixed a bug

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

* [Bug c++/106633] Hidden visibility on forward declarations impacts visibility of default-visibility class methods
  2022-08-15 23:44 [Bug c++/106633] New: Hidden visibility on forward declarations impacts visibility of default-visibility class methods mh+gcc at glandium dot org
  2022-08-15 23:50 ` [Bug c++/106633] " pinskia at gcc dot gnu.org
@ 2022-08-16  1:05 ` mh+gcc at glandium dot org
  1 sibling, 0 replies; 3+ messages in thread
From: mh+gcc at glandium dot org @ 2022-08-16  1:05 UTC (permalink / raw)
  To: gcc-bugs

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

Mike Hommey <mh+gcc at glandium dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Mike Hommey <mh+gcc at glandium dot org> ---
Started with
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a53781c8fd258608780821168a7f5faf7be63690;hp=ba9b07d0259b38a9eccd4eb0df327d3aaabad3c6

... which points to the fact that this is now consistent with the behavior of
forward declarations of any other class...

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

end of thread, other threads:[~2022-08-16  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 23:44 [Bug c++/106633] New: Hidden visibility on forward declarations impacts visibility of default-visibility class methods mh+gcc at glandium dot org
2022-08-15 23:50 ` [Bug c++/106633] " pinskia at gcc dot gnu.org
2022-08-16  1:05 ` mh+gcc at glandium dot 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).