Last active
December 10, 2015 12:33
-
-
Save EricWF/7eb0c5dd4857c73d7828 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // g++ -std=c++11 test.cpp | |
| template <class Tp> | |
| struct MyType { | |
| __attribute__((visibility("hidden"), always_inline)) ~MyType(); | |
| }; | |
| // Moving the definition above this line will allow the compilation to succeed. Why? | |
| extern template __attribute__((visibility("default"))) MyType<int>::~MyType(); | |
| // DEFINITION | |
| template <class Tp> inline MyType<Tp>::~MyType() {} | |
| // Other is a class that requires the definition of MyType<size_t>::~MyType() | |
| struct GeneratedDtor { MyType<int> t; }; | |
| GeneratedDtor o; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment