Re: C++ templates and visibility("hidden")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Parpart schrieb:
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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux