public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106395] New: [10/11 regression] [mingw] "redeclared without dllimport attribute: previous dllimport ignored" on C++ friend
@ 2022-07-21 21:17 thiago at kde dot org
  2022-07-22  7:12 ` [Bug c++/106395] [12/13 " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: thiago at kde dot org @ 2022-07-21 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106395
           Summary: [10/11 regression] [mingw] "redeclared without
                    dllimport attribute: previous dllimport ignored" on
                    C++ friend
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thiago at kde dot org
  Target Milestone: ---

__attribute__((dllimport)) void f();
class S
{
private:
    int i;
    friend __attribute__((dllimport)) void f();
};

With GCC 10.3.0 (OpenSUSE Tumbleweed):
$ x86_64-w64-mingw32-gcc -c -Werror /tmp/test.cpp        

With GCC 11.2.1 (Fedora 35 & 36):
$ x86_64-w64-mingw32-gcc -Wall -Wextra -Werror -c /tmp/test.cpp

With GCC 12.1.0 (Arch Linux, self built):
$ x86_64-w64-mingw32-g++ -Werror -c /tmp/test.cpp
/tmp/test.cpp:6:44: error: ‘void f()’ redeclared without dllimport attribute:
previous dllimport ignored [-Werror=attributes]
    6 |     friend __attribute__((dllimport)) void f();
      |                                            ^
cc1plus: all warnings being treated as errors

GCC 12 is obviously wrong because it is complaining that the attribute is
missing and then shows that the attribute is right there.

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

end of thread, other threads:[~2023-05-08 12:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 21:17 [Bug c++/106395] New: [10/11 regression] [mingw] "redeclared without dllimport attribute: previous dllimport ignored" on C++ friend thiago at kde dot org
2022-07-22  7:12 ` [Bug c++/106395] [12/13 " rguenth at gcc dot gnu.org
2022-08-01 16:10 ` m101010a at gmail dot com
2022-08-10 13:15 ` [Bug c++/106395] [12/13 regression] [mingw] "redeclared without dllimport attribute: previous dllimport ignored" on C++ friend since r12-299-ga0fdff3cf33f72 rguenth at gcc dot gnu.org
2022-12-26 15:15 ` nightstrike at gmail dot com
2023-01-17 18:51 ` i.nixman at autistici dot org
2023-05-08 12:25 ` [Bug c++/106395] [12 " rguenth 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).