struct ImplicitInst_Imported {};
struct ExplicitDecl_Imported {};
struct ExplicitInst_Imported {};
struct ExplicitSpec_Imported {};
struct ExplicitSpec_Def_Imported {};
struct ExplicitSpec_InlineDef_Imported {};
struct ExplicitSpec_NotImported {};
#define JOIN2(x, y) x##y
#define JOIN(x, y) JOIN2(x, y)
#define UNIQ(name) JOIN(name, __LINE__)
#define USE(func) void UNIQ(use)() { func(); }
#define USEMV(cls, var) int UNIQ(use)() { return ref(cls::var); }
#define USEMF(cls, fun) template<> void useMemFun<__LINE__, cls>() { cls().fun(); }
#define USESPECIALS(cls) void UNIQ(use)() { useSpecials<cls>(); }
template<typename T>
T ref(T const& v) { return v; }
template<int Line, typename T>
void useMemFun();
template<typename T>
void useSpecials() {
T v;
T c1(static_cast<const T&>(v)); T c2 = static_cast<const T&>(v); T c3;
c3 = static_cast<const T&>(v);
T m1(static_cast<T&&>(v)); T m2 = static_cast<T&&>(v); T m3;
m3 = static_cast<T&&>(v); }
struct __declspec(dllimport) ForceNonTrivial {
ForceNonTrivial();
~ForceNonTrivial();
ForceNonTrivial(const ForceNonTrivial&);
ForceNonTrivial& operator=(const ForceNonTrivial&);
ForceNonTrivial(ForceNonTrivial&&);
ForceNonTrivial& operator=(ForceNonTrivial&&);
};
struct ImportMembers {
struct Nested;
__declspec(dllimport) void normalDef(); __declspec(dllimport) void normalDecl();
__declspec(dllimport) void normalInclass() {}
__declspec(dllimport) void normalInlineDef();
__declspec(dllimport) inline void normalInlineDecl();
__declspec(dllimport) virtual void virtualDef(); __declspec(dllimport) virtual void virtualDecl();
__declspec(dllimport) virtual void virtualInclass() {}
__declspec(dllimport) virtual void virtualInlineDef();
__declspec(dllimport) virtual inline void virtualInlineDecl();
__declspec(dllimport) static void staticDef(); __declspec(dllimport) static void staticDecl();
__declspec(dllimport) static void staticInclass() {}
__declspec(dllimport) static void staticInlineDef();
__declspec(dllimport) static inline void staticInlineDecl();
protected:
__declspec(dllimport) void protectedNormalDecl();
__declspec(dllimport) static void protectedStaticDecl();
private:
__declspec(dllimport) void privateNormalDecl();
__declspec(dllimport) static void privateStaticDecl();
public:
void ignored();
__declspec(dllimport) static int StaticField;
__declspec(dllimport) static const int StaticConstField;
__declspec(dllimport) static const int StaticConstFieldEqualInit = 1;
__declspec(dllimport) static const int StaticConstFieldBraceInit{1};
__declspec(dllimport) constexpr static int ConstexprField = 1;
template<int Line, typename T> friend void useMemFun();
};
void ImportMembers::normalDef() {} inline void ImportMembers::normalInlineDef() {}
void ImportMembers::normalInlineDecl() {}
void ImportMembers::virtualDef() {} inline void ImportMembers::virtualInlineDef() {}
void ImportMembers::virtualInlineDecl() {}
void ImportMembers::staticDef() {} inline void ImportMembers::staticInlineDef() {}
void ImportMembers::staticInlineDecl() {}
USEMF(ImportMembers, normalDef)
USEMF(ImportMembers, normalDecl)
USEMF(ImportMembers, normalInclass)
USEMF(ImportMembers, normalInlineDef)
USEMF(ImportMembers, normalInlineDecl)
USEMF(ImportMembers, virtualDef)
USEMF(ImportMembers, virtualDecl)
USEMF(ImportMembers, virtualInclass)
USEMF(ImportMembers, virtualInlineDef)
USEMF(ImportMembers, virtualInlineDecl)
USEMF(ImportMembers, staticDef)
USEMF(ImportMembers, staticDecl)
USEMF(ImportMembers, staticInclass)
USEMF(ImportMembers, staticInlineDef)
USEMF(ImportMembers, staticInlineDecl)
USEMF(ImportMembers, protectedNormalDecl)
USEMF(ImportMembers, protectedStaticDecl)
USEMF(ImportMembers, privateNormalDecl)
USEMF(ImportMembers, privateStaticDecl)
USEMF(ImportMembers, ignored)
USEMV(ImportMembers, StaticField)
USEMV(ImportMembers, StaticConstField)
USEMV(ImportMembers, StaticConstFieldEqualInit)
USEMV(ImportMembers, StaticConstFieldBraceInit)
USEMV(ImportMembers, ConstexprField)
struct ImportMembers::Nested {
__declspec(dllimport) void normalDef(); __declspec(dllimport) void normalDecl();
__declspec(dllimport) void normalInclass() {}
__declspec(dllimport) void normalInlineDef();
__declspec(dllimport) inline void normalInlineDecl();
__declspec(dllimport) virtual void virtualDef(); __declspec(dllimport) virtual void virtualDecl();
__declspec(dllimport) virtual void virtualInclass() {}
__declspec(dllimport) virtual void virtualInlineDef();
__declspec(dllimport) virtual inline void virtualInlineDecl();
__declspec(dllimport) static void staticDef(); __declspec(dllimport) static void staticDecl();
__declspec(dllimport) static void staticInclass() {}
__declspec(dllimport) static void staticInlineDef();
__declspec(dllimport) static inline void staticInlineDecl();
protected:
__declspec(dllimport) void protectedNormalDecl();
__declspec(dllimport) static void protectedStaticDecl();
private:
__declspec(dllimport) void privateNormalDecl();
__declspec(dllimport) static void privateStaticDecl();
public:
void ignored();
__declspec(dllimport) static int StaticField;
__declspec(dllimport) static const int StaticConstField;
__declspec(dllimport) static const int StaticConstFieldEqualInit = 1;
__declspec(dllimport) static const int StaticConstFieldBraceInit{1};
__declspec(dllimport) constexpr static int ConstexprField = 1;
template<int Line, typename T> friend void useMemFun();
};
void ImportMembers::Nested::normalDef() {} inline void ImportMembers::Nested::normalInlineDef() {}
void ImportMembers::Nested::normalInlineDecl() {}
void ImportMembers::Nested::virtualDef() {} inline void ImportMembers::Nested::virtualInlineDef() {}
void ImportMembers::Nested::virtualInlineDecl() {}
void ImportMembers::Nested::staticDef() {} inline void ImportMembers::Nested::staticInlineDef() {}
void ImportMembers::Nested::staticInlineDecl() {}
USEMF(ImportMembers::Nested, normalDef)
USEMF(ImportMembers::Nested, normalDecl)
USEMF(ImportMembers::Nested, normalInclass)
USEMF(ImportMembers::Nested, normalInlineDef)
USEMF(ImportMembers::Nested, normalInlineDecl)
USEMF(ImportMembers::Nested, virtualDef)
USEMF(ImportMembers::Nested, virtualDecl)
USEMF(ImportMembers::Nested, virtualInclass)
USEMF(ImportMembers::Nested, virtualInlineDef)
USEMF(ImportMembers::Nested, virtualInlineDecl)
USEMF(ImportMembers::Nested, staticDef)
USEMF(ImportMembers::Nested, staticDecl)
USEMF(ImportMembers::Nested, staticInclass)
USEMF(ImportMembers::Nested, staticInlineDef)
USEMF(ImportMembers::Nested, staticInlineDecl)
USEMF(ImportMembers::Nested, protectedNormalDecl)
USEMF(ImportMembers::Nested, protectedStaticDecl)
USEMF(ImportMembers::Nested, privateNormalDecl)
USEMF(ImportMembers::Nested, privateStaticDecl)
USEMF(ImportMembers::Nested, ignored)
USEMV(ImportMembers::Nested, StaticField)
USEMV(ImportMembers::Nested, StaticConstField)
USEMV(ImportMembers::Nested, StaticConstFieldEqualInit)
USEMV(ImportMembers::Nested, StaticConstFieldBraceInit)
USEMV(ImportMembers::Nested, ConstexprField)
struct ImportSpecials {
__declspec(dllimport) ImportSpecials();
__declspec(dllimport) ~ImportSpecials();
__declspec(dllimport) ImportSpecials(const ImportSpecials&);
__declspec(dllimport) ImportSpecials& operator=(const ImportSpecials&);
__declspec(dllimport) ImportSpecials(ImportSpecials&&);
__declspec(dllimport) ImportSpecials& operator=(ImportSpecials&&);
};
USESPECIALS(ImportSpecials)
struct ImportInlineSpecials {
__declspec(dllimport) ImportInlineSpecials() {}
__declspec(dllimport) ~ImportInlineSpecials() {}
__declspec(dllimport) inline ImportInlineSpecials(const ImportInlineSpecials&);
__declspec(dllimport) ImportInlineSpecials& operator=(const ImportInlineSpecials&);
__declspec(dllimport) ImportInlineSpecials(ImportInlineSpecials&&) {}
__declspec(dllimport) ImportInlineSpecials& operator=(ImportInlineSpecials&&) { return *this; }
};
ImportInlineSpecials::ImportInlineSpecials(const ImportInlineSpecials&) {}
inline ImportInlineSpecials& ImportInlineSpecials::operator=(const ImportInlineSpecials&) { return *this; }
USESPECIALS(ImportInlineSpecials)
struct ImportDefaulted {
__declspec(dllimport) ImportDefaulted() = default;
__declspec(dllimport) ~ImportDefaulted() = default;
__declspec(dllimport) ImportDefaulted(const ImportDefaulted&) = default;
__declspec(dllimport) ImportDefaulted& operator=(const ImportDefaulted&) = default;
__declspec(dllimport) ImportDefaulted(ImportDefaulted&&) = default;
__declspec(dllimport) ImportDefaulted& operator=(ImportDefaulted&&) = default;
ForceNonTrivial v; };
USESPECIALS(ImportDefaulted)
struct ImportDefaultedDefs {
__declspec(dllimport) inline ImportDefaultedDefs();
__declspec(dllimport) inline ~ImportDefaultedDefs();
__declspec(dllimport) ImportDefaultedDefs(const ImportDefaultedDefs&);
__declspec(dllimport) ImportDefaultedDefs& operator=(const ImportDefaultedDefs&);
__declspec(dllimport) ImportDefaultedDefs(ImportDefaultedDefs&&);
__declspec(dllimport) ImportDefaultedDefs& operator=(ImportDefaultedDefs&&);
};
#ifdef MSABI
__declspec(dllimport) ImportDefaultedDefs::ImportDefaultedDefs() = default;
#endif
#ifdef MSABI
__declspec(dllimport) ImportDefaultedDefs::~ImportDefaultedDefs() = default;
#endif
inline ImportDefaultedDefs::ImportDefaultedDefs(const ImportDefaultedDefs&) = default;
inline ImportDefaultedDefs& ImportDefaultedDefs::operator=(const ImportDefaultedDefs&) = default;
ImportDefaultedDefs::ImportDefaultedDefs(ImportDefaultedDefs&&) = default;
ImportDefaultedDefs& ImportDefaultedDefs::operator=(ImportDefaultedDefs&&) = default;
USESPECIALS(ImportDefaultedDefs)
struct ImportAlloc {
__declspec(dllimport) void* operator new(__SIZE_TYPE__);
__declspec(dllimport) void* operator new[](__SIZE_TYPE__);
__declspec(dllimport) void operator delete(void*);
__declspec(dllimport) void operator delete[](void*);
};
void UNIQ(use)() { new ImportAlloc(); }
void UNIQ(use)() { new ImportAlloc[1]; }
void UNIQ(use)(ImportAlloc* ptr) { delete ptr; }
void UNIQ(use)(ImportAlloc* ptr) { delete[] ptr; }
struct MemFunTmpl {
template<typename T> void normalDef() {}
template<typename T> __declspec(dllimport) void importedNormal() {}
template<typename T> static void staticDef() {}
template<typename T> __declspec(dllimport) static void importedStatic() {}
};
USEMF(MemFunTmpl, importedNormal<ImplicitInst_Imported>)
USE(MemFunTmpl::importedStatic<ImplicitInst_Imported>)
extern template void MemFunTmpl::importedNormal<ExplicitDecl_Imported>();
USEMF(MemFunTmpl, importedNormal<ExplicitDecl_Imported>)
extern template void MemFunTmpl::importedStatic<ExplicitDecl_Imported>();
USE(MemFunTmpl::importedStatic<ExplicitDecl_Imported>)
template void MemFunTmpl::importedNormal<ExplicitInst_Imported>();
USEMF(MemFunTmpl, importedNormal<ExplicitInst_Imported>)
template void MemFunTmpl::importedStatic<ExplicitInst_Imported>();
USE(MemFunTmpl::importedStatic<ExplicitInst_Imported>)
template<> __declspec(dllimport) void MemFunTmpl::importedNormal<ExplicitSpec_Imported>();
USEMF(MemFunTmpl, importedNormal<ExplicitSpec_Imported>)
#ifdef MSABI
#endif
template<> __declspec(dllimport) inline void MemFunTmpl::importedNormal<ExplicitSpec_InlineDef_Imported>() {}
USEMF(MemFunTmpl, importedNormal<ExplicitSpec_InlineDef_Imported>)
template<> __declspec(dllimport) void MemFunTmpl::importedStatic<ExplicitSpec_Imported>();
USE(MemFunTmpl::importedStatic<ExplicitSpec_Imported>)
#ifdef MSABI
#endif
template<> __declspec(dllimport) inline void MemFunTmpl::importedStatic<ExplicitSpec_InlineDef_Imported>() {}
USE(MemFunTmpl::importedStatic<ExplicitSpec_InlineDef_Imported>)
template<> void MemFunTmpl::importedNormal<ExplicitSpec_NotImported>() {}
USEMF(MemFunTmpl, importedNormal<ExplicitSpec_NotImported>)
template<> void MemFunTmpl::importedStatic<ExplicitSpec_NotImported>() {}
USE(MemFunTmpl::importedStatic<ExplicitSpec_NotImported>)
extern template __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitDecl_Imported>();
USEMF(MemFunTmpl, normalDef<ExplicitDecl_Imported>)
extern template __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitDecl_Imported>();
USE(MemFunTmpl::staticDef<ExplicitDecl_Imported>)
template __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitInst_Imported>();
USEMF(MemFunTmpl, normalDef<ExplicitInst_Imported>)
template __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitInst_Imported>();
USE(MemFunTmpl::staticDef<ExplicitInst_Imported>)
template<> __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitSpec_Imported>();
USEMF(MemFunTmpl, normalDef<ExplicitSpec_Imported>)
#ifdef MSABI
#endif
template<> __declspec(dllimport) inline void MemFunTmpl::normalDef<ExplicitSpec_InlineDef_Imported>() {}
USEMF(MemFunTmpl, normalDef<ExplicitSpec_InlineDef_Imported>)
template<> __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitSpec_Imported>();
USE(MemFunTmpl::staticDef<ExplicitSpec_Imported>)
#ifdef MSABI
#endif
template<> __declspec(dllimport) inline void MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Imported>() {}
USE(MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Imported>)
struct MemVarTmpl {
template<typename T> static const int StaticVar = 1;
template<typename T> __declspec(dllimport) static const int ImportedStaticVar = 1;
};
USEMV(MemVarTmpl, ImportedStaticVar<ImplicitInst_Imported>)
extern template const int MemVarTmpl::ImportedStaticVar<ExplicitDecl_Imported>;
USEMV(MemVarTmpl, ImportedStaticVar<ExplicitDecl_Imported>)
template<> __declspec(dllimport) const int MemVarTmpl::ImportedStaticVar<ExplicitSpec_Imported>;
USEMV(MemVarTmpl, ImportedStaticVar<ExplicitSpec_Imported>)
template<> const int MemVarTmpl::ImportedStaticVar<ExplicitSpec_NotImported>;
USEMV(MemVarTmpl, ImportedStaticVar<ExplicitSpec_NotImported>)
extern template __declspec(dllimport) const int MemVarTmpl::StaticVar<ExplicitDecl_Imported>;
USEMV(MemVarTmpl, StaticVar<ExplicitDecl_Imported>)
template<> __declspec(dllimport) const int MemVarTmpl::StaticVar<ExplicitSpec_Imported>;
USEMV(MemVarTmpl, StaticVar<ExplicitSpec_Imported>)