public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ph0enix at ngs dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/28449]  New: failed to build DSO with STL and hidden visibility enabled
Date: Thu, 20 Jul 2006 20:14:00 -0000	[thread overview]
Message-ID: <bug-28449-12986@http.gcc.gnu.org/bugzilla/> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2671 bytes --]

simplified test-case:
#include <set>

class __attribute__ ((visibility("default"))) foo {
public:
    typedef std::set<int> int_set;
    int_set::const_iterator begin() const;

private:
    int_set m_set;
};

foo::int_set::const_iterator foo::begin() const {
    return m_set.begin();
}

compile it:
$ g++-4.2.0-alpha20060715 -fPIC -shared -Wall -fvisibility=hidden test.cc -o
test.so
test.cc:6: warning: ‘std::_Rb_tree_const_iterator<int> foo::begin() const’
declared with greater visibility than its type
test.cc:3: warning: ‘foo’ declared with greater visibility than the type of
its field ‘foo::m_set’

foo::begin()/m_set are not exported

it can be repaired by adding typedef for const_iterator and placing it and
typedef for set outside of class
or wrapping include
#pragma GCC visibility push(default)
#include <set>
#pragma GCC visibility pop
at this case if client of DSO also includes <set> before including my header -
he will get the same warning as above, but code seems to be working.
so, question is - shouldn't push/pop visibility placed in stl headers?
there were no such problem w/ gcc-4.2.0_alpha20060603

$ g++-4.2.0-alpha20060715 -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/var/tmp/portage/gcc-4.2.0_alpha20060715/work/gcc-4.2-20060715/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.2.0-alpha20060715
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.2.0-alpha20060715/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.0-alpha20060715
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.0-alpha20060715/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.0-alpha20060715/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.2.0-alpha20060715/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++
--enable-shared --enable-threads=posix --enable-bootstrap --enable-__cxa_atexit
--enable-clocale=gnu
Thread model: posix
gcc version 4.2.0-alpha20060715  (experimental) (Gentoo 4.2.0_alpha20060715)


-- 
           Summary: failed to build DSO with STL and hidden visibility
                    enabled
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ph0enix at ngs dot ru


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28449


             reply	other threads:[~2006-07-20 20:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20 20:14 ph0enix at ngs dot ru [this message]
2006-07-20 22:02 ` [Bug c++/28449] " pinskia at gcc dot gnu dot org

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-28449-12986@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: link
Be 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).