Hi all,
I'm not sure that I ran into a bug, but I'm quite sure about that - because the other way around just looks ugly.
When using CXXFLAGS="-fvisibility=hidden" and declaring the following in a file for a shared library:
#define MY_API __attribute__((visibility("default")))
template<class T> MY_API class U { public: void f(T v); };
listen to your compiler:
c++template-visibility.h:19: warning: attribute ignored in declaration of 'class TFoo<T>'
c++template-visibility.h:19: warning: attribute for 'class TFoo<T>' must follow the 'class' keyword
and note that you can only export instantiations of templates.
-- Stefan Strasser