Workaround clang 10.0.1 C++17 linker errors in testcases

Fixes:
  Undefined symbols for architecture x86_64: "___cxa_deleted_virtual"
which clang issues when a class deletes a method (seems to be when the
function is not one of the compiler's automatically added special member
functions).
This commit is contained in:
William S Fulton 2019-06-14 19:23:55 +01:00
commit 06e5ab8975
2 changed files with 11 additions and 0 deletions

View file

@ -28,7 +28,13 @@ A1::A1(const A1&) = default;
struct A2 {
void funk(int i) {}
// Workaround clang 10.0.1 -std=c++17 linker error (oddly for Java and not Python):
// Undefined symbols for architecture x86_64:"___cxa_deleted_virtual", referenced from: vtable for A2
#if !(defined(__clang__) && __cplusplus >= 201703L)
virtual void fff(int) = delete;
#endif
virtual ~A2() = default;
template<class T> void funk(T) = delete;
};

View file

@ -31,8 +31,13 @@ struct NoExceptClass {
void noo1() const noexcept {}
static void noo2() noexcept {}
virtual void noo3() const noexcept {}
// Workaround clang 10.0.1 -std=c++17 linker error (oddly for Java and not Python):
// Undefined symbols for architecture x86_64: "___cxa_deleted_virtual", referenced from: vtable for NoExceptClass
#if !(defined(__clang__) && __cplusplus >= 201703L)
virtual void noo4() const noexcept = delete;
virtual void noo5() const throw() = delete;
#endif
};
struct NoExceptAbstract {