From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12512 invoked by alias); 20 Jul 2006 20:14:05 -0000 Received: (qmail 12489 invoked by uid 48); 20 Jul 2006 20:13:55 -0000 Date: Thu, 20 Jul 2006 20:14:00 -0000 Subject: [Bug c++/28449] New: failed to build DSO with STL and hidden visibility enabled X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ph0enix at ngs dot ru" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-07/txt/msg01611.txt.bz2 List-Id: simplified test-case: #include class __attribute__ ((visibility("default"))) foo { public: typedef std::set 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 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 #pragma GCC visibility pop at this case if client of DSO also includes 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