public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "sldev327 at softmagi dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/34749] New: Incorrect warning when applying dllimport to friend function Date: Sat, 12 Jan 2008 15:14:00 -0000 [thread overview] Message-ID: <bug-34749-15619@http.gcc.gnu.org/bugzilla/> (raw) I was playing with some code and got a warning about dllimport in some headers. I looked around a bit and came up with this test case. The warning seems to imply that dllimport is ignored on bar(), but looking at the output the call to bar() is indeed mangled with __imp prefix. I'm using MinGW g++ 4.2.1-dw2. ## begin df.cpp __attribute__((dllimport)) int bar(); class Foo { private: int foo(); friend __attribute__((dllimport)) int bar(); }; int Foo::foo() { return bar(); } ## end df.cpp D:> g++ -S df.cpp df.cpp:7: warning: 'int bar()' redeclared without dllimport attribute: previous dllimport ignored D:> g++ -v Using built-in specs. Target: mingw32 Configured with: ../gcc-4.2.1-2-src/configure --with-gcc --enable-libgomp --host =mingw32 --build=mingw32 --target=mingw32 --program-suffix=-dw2 --with-arch=i486 --with-tune=generic --disable-werror --prefix=/mingw --with-local-prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c+ +,fortran,objc,obj-c++,ad a --disable-win32-registry --disable-sjlj-exceptions --enable-libstdcxx-debug -- enable-cxx-flags=-fno-function-sections -fno-data-sections --enable-version-spec ific-runtime-libs --disable-bootstrap Thread model: win32 gcc version 4.2.1-dw2 (mingw32-2) -- Summary: Incorrect warning when applying dllimport to friend function Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sldev327 at softmagi dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34749
next reply other threads:[~2008-01-12 14:16 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-01-12 15:14 sldev327 at softmagi dot com [this message] 2008-01-13 2:24 ` [Bug c++/34749] " bangerth at dealii dot org 2008-01-13 10:23 ` sldev327 at softmagi dot com 2008-01-13 10:24 ` dannysmith at users dot sourceforge dot net 2008-01-13 10:27 ` dannysmith at users dot sourceforge dot net 2008-01-19 10:44 ` dannysmith at users dot sourceforge dot net 2008-02-24 9:21 ` dannysmith at gcc dot gnu dot org 2008-09-26 3:16 ` dannysmith at users dot sourceforge dot net 2009-01-11 12:08 ` angry-kasyan at narod dot ru 2009-01-12 2:07 ` dannysmith at users dot sourceforge dot net 2009-01-13 8:12 ` angry-kasyan at narod dot ru
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-34749-15619@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).