Commit 65a73ea7 authored by NiklasRosenstein's avatar NiklasRosenstein Committed by Davis E. King

Fix #1479 -- member_function_pointer_kernel_1.h does not compile with MSVC /vms (#1481)

Add the __virtual_inheritance keyword to dummy struct when compiling with MSVC.
parent 7b006f37
...@@ -116,8 +116,19 @@ namespace dlib ...@@ -116,8 +116,19 @@ namespace dlib
} }
}; };
// MSVC with the /vms option, we get C2287 since the dummy class requires virtual
// inheritance. Adding the __virtual_inheritance specifier explicitly fixes the issue,
// but then Clang-CL no longer accepts it.
#if defined(_MSC_VER) && !defined(__clang__)
#define DLIB_MSVC_INHERITANCE_VIRTUAL __virtual_inheritance
#else
#define DLIB_MSVC_INHERITANCE_VIRTUAL
#endif
struct dummy_base { virtual void nonnull() {}; virtual ~dummy_base(){}; int a; }; struct dummy_base { virtual void nonnull() {}; virtual ~dummy_base(){}; int a; };
struct dummy : virtual public dummy_base{ void nonnull() {}; }; struct DLIB_MSVC_INHERITANCE_VIRTUAL dummy : virtual public dummy_base{ void nonnull() {}; };
#undef DLIB_MSVC_INHERITANCE_VIRTUAL
typedef mp_impl_T<mp_null<dummy> > mp_null_impl; typedef mp_impl_T<mp_null<dummy> > mp_null_impl;
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment