Skip to content
Snippets Groups Projects
Commit 033a7f87 authored by Matthew Woehlke's avatar Matthew Woehlke
Browse files

WIPWIPWIP

parent d8a1fece
Branches master
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@ int main()
{
{
libshared::Class l;
//l.method(); LINK ERROR
l.method_exported();
//l.method_deprecated(); LINK ERROR
......@@ -70,6 +71,7 @@ int main()
{
libshared::ExportedClass l;
l.method();
l.method_deprecated();
#ifdef _WIN32
......@@ -88,6 +90,7 @@ int main()
{
libshared::ExcludedClass l;
//l.method(); LINK ERROR
l.method_exported();
//l.method_deprecated(); LINK ERROR
......@@ -99,6 +102,23 @@ int main()
//use_int(l.data_excluded); LINK ERROR
}
{
libshared::TemplateClass<int> l;
(void)l; // suppress possible 'unused variable' warning
//l.method(); LINK ERROR
//use_int(l.data); LINK ERROR
}
{
libshared::ExportedTemplateClass<int> l;
l.method();
use_int(l.data);
}
//libshared::function(); LINK ERROR
libshared::function_exported();
//libshared::function_deprecated(); LINK ERROR
......@@ -111,6 +131,7 @@ int main()
{
libstatic::Class l;
l.method();
l.method_exported();
l.method_deprecated();
......@@ -124,6 +145,7 @@ int main()
{
libstatic::ExportedClass l;
l.method();
l.method_exported();
l.method_deprecated();
......@@ -137,6 +159,7 @@ int main()
{
libstatic::ExcludedClass l;
l.method();
l.method_exported();
l.method_deprecated();
......
......@@ -75,6 +75,24 @@ int libshared::ExcludedClass::method_excluded() const
return 0;
}
template <typename T> T libshared::TemplateClass<T>::method()
{
return 0;
}
template <typename T> T libshared::ExportedTemplateClass<T>::method()
{
return 0;
}
template <typename T> T const libshared::TemplateClass<T>::data = 0;
template <typename T> T const libshared::ExportedTemplateClass<T>::data = 0;
template class libshared::TemplateClass<int>;
template class LIBSHARED_EXPORT libshared::ExportedTemplateClass<int>;
int const libshared::ExcludedClass::data = 1;
int const libshared::ExcludedClass::data_exported = 1;
......@@ -106,6 +124,20 @@ int libshared::function_excluded()
return 0;
}
template <typename T> T libshared::template_function()
{
return 0;
}
template <typename T> T libshared::template_function_exported()
{
return 0;
}
template int libshared::template_function<int>();
template int LIBSHARED_EXPORT libshared::template_function_exported<int>();
int const libshared::data = 1;
int const libshared::data_exported = 1;
......
......@@ -60,6 +60,28 @@ public:
static int const LIBSHARED_NO_EXPORT data_excluded;
};
template <typename T>
class TemplateClass
{
public:
T method();
static T const data;
};
template <typename T>
class LIBSHARED_EXPORT ExportedTemplateClass
{
public:
T method();
static T const data;
};
extern template class TemplateClass<int>;
extern template class LIBSHARED_EXPORT ExportedTemplateClass<int>;
int function();
int LIBSHARED_EXPORT function_exported();
......@@ -70,6 +92,14 @@ int LIBSHARED_DEPRECATED_EXPORT function_deprecated_exported();
int LIBSHARED_NO_EXPORT function_excluded();
template <typename T> T template_function();
template <typename T> LIBSHARED_EXPORT T template_function_exported();
extern template int template_function<int>();
extern template LIBSHARED_EXPORT int template_function_exported<int>();
extern int const data;
extern int const LIBSHARED_EXPORT data_exported;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment