Version-Release number of selected component (if applicable): 4.1.1-7 WARNING: C++ doofus here. Consider the following foo.cpp: #include <list> class __attribute__((visibility("default"))) Foo { public: Foo(); ~Foo(); std::list<std::string> Bar(); }; $ g++ -Wall -c -o foo.o foo.cpp -fvisibility=hidden foo.cpp:8: warning: âstd::list<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > Foo::Bar()â declared with greater visibility than its type Shouldn't the standard libstdc++ template types (std::list, etc) be visible? Adding #pragma GCC visiblity push & pop around the "#include <list>" fixes it, but that seems wrong.
Erm, assume there's a #include <string> in there. :) It still errors...
I thought libstdc++ (particularly bits/c++config) already uses __attribute__((visibility ("default"))) on the std namespace (and similar namespaces), but apparently it doesn't.
This isn't anything new BTW, it has never been there so far and thus code without default visibility around the standard headers has always been broken.
Ok, then rather than munge all the #include statements in the package, I can turn off the visibility flag for the build for now. Any chance that at least libstdc++ could be fixed to have proper visiblity in the headers?
GCC 4.3 will have that, but for 4.1 such changes are IMHO way too invasive.