From 06e5ab897561309dce7b8ecbaeb333bbe152f373 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 14 Jun 2019 19:23:55 +0100 Subject: 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). --- Examples/test-suite/cpp11_default_delete.i | 6 ++++++ Examples/test-suite/cpp11_noexcept.i | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Examples/test-suite/cpp11_default_delete.i b/Examples/test-suite/cpp11_default_delete.i index b5e84ed51..0c20fb7ee 100644 --- a/Examples/test-suite/cpp11_default_delete.i +++ b/Examples/test-suite/cpp11_default_delete.i @@ -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 void funk(T) = delete; }; diff --git a/Examples/test-suite/cpp11_noexcept.i b/Examples/test-suite/cpp11_noexcept.i index a77eb046f..8aa0baa5a 100644 --- a/Examples/test-suite/cpp11_noexcept.i +++ b/Examples/test-suite/cpp11_noexcept.i @@ -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 { -- cgit v1.2.3