From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1120 invoked by alias); 7 Nov 2011 09:24:43 -0000 Received: (qmail 1108 invoked by uid 22791); 7 Nov 2011 09:24:41 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Nov 2011 09:24:28 +0000 From: "vincenzo.innocente at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/35688] template visibility not overridden by template arguments Date: Mon, 07 Nov 2011 09:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincenzo.innocente at cern dot ch X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00572.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35688 --- Comment #7 from vincenzo Innocente 2011-11-07 09:23:30 UTC --- The situation now is even more confused. Most of the std algos have iterators as arguments. Visibility seems not to propagate there.. below is my extensive test compile as c++ -O0 -shared -fPIC -fvisibility=hidden -o bha.so testICF.cpp nm bha.so | c++filt and look at the mixture of " t " and " T " for instance 000000000000ad7f t void std::__adjust_heap<__gnu_cxx::__normal_iterator > >, long, C*>(__gnu_cxx::__normal_iterator > >, long, long, C*) 000000000000afea T void std::__iter_swap::iter_swap<__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator etc cat testICF.cpp #include #include #include struct A { A(float q=0): v(q){} float v; bool operator<(A const & a) const { return v int game(std::vector const & a, std::vector & b) { typedef typename std::vector::const_iterator Iter; for (Iter i=a.begin(); i!=a.end(); ++i) { if ( (*i).v>0.) b.push_back((*i).v+1); } std::sort(b.begin(),b.end()); return b.size(); } template int gamep(std::vector const & a, std::vector & b) { typedef typename std::vector::const_iterator Iter; for (Iter i=a.begin(); i!=a.end(); ++i) { if ( (*i)->v>0.) b.push_back((*i)); } std::sort(b.begin(),b.end()); return b.size(); } namespace data /* __attribute__((visibility("default"))) */ { std::vector a; std::vector b; std::vector c; std::vector ap; std::vector bp; std::vector cp; } #include int __attribute__((visibility("default"))) go() { using namespace data; int ret=0; try { ret+=game(a,a); ret+=game(b,b); ret+=game(c,c); ret+=gamep(ap,ap); ret+=gamep(bp,bp); ret+=gamep(cp,cp); } catch (std::exception & ce) { std::cout << ce.what() << std::endl; } return ret; }