From c3eff9234c5aaca49be12758bb6b2cc4dc18623f Mon Sep 17 00:00:00 2001 From: Marvin Greenberg Date: Fri, 31 Jan 2014 16:03:14 -0500 Subject: [PATCH] Workaround for clang 3.2 libc++ empty struct bug. Certain tests have empty structs or classes. This encounters a bug with clang: http://llvm.org/bugs/show_bug.cgi?id=16764 This is fixed in later versions of clang, but not the version currently bundled with Mavericks and XCode 5 --- Examples/test-suite/constructor_copy.i | 6 ++++-- Examples/test-suite/ignore_template_constructor.i | 10 ++++++---- Examples/test-suite/smart_pointer_inherit.i | 1 + Examples/test-suite/std_containers.i | 3 ++- Examples/test-suite/template_matrix.i | 1 + Examples/test-suite/template_opaque.i | 1 + 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Examples/test-suite/constructor_copy.i b/Examples/test-suite/constructor_copy.i index f6bdcb240..bfbd706f4 100644 --- a/Examples/test-suite/constructor_copy.i +++ b/Examples/test-suite/constructor_copy.i @@ -94,14 +94,16 @@ public: namespace Space { class Flow { +int x; public: - Flow(int i) {} + Flow(int i) : x(i) {} }; class FlowFlow { +int x; public: - FlowFlow(int i) {} + FlowFlow(int i) : x(i) {} }; } diff --git a/Examples/test-suite/ignore_template_constructor.i b/Examples/test-suite/ignore_template_constructor.i index ffd541986..31a5505fb 100644 --- a/Examples/test-suite/ignore_template_constructor.i +++ b/Examples/test-suite/ignore_template_constructor.i @@ -17,9 +17,10 @@ #if defined(SWIG_GOOD_VECTOR) %inline %{ class Flow { - Flow() {} +double x; + Flow():x(0.0) {} public: - Flow(double d) {} + Flow(double d) : x(d) {} }; %} @@ -28,9 +29,10 @@ public: %inline %{ class Flow { +double x; public: - Flow() {} - Flow(double d) {} + Flow(): x(0.0) {} + Flow(double d) : x(d) {} }; %} diff --git a/Examples/test-suite/smart_pointer_inherit.i b/Examples/test-suite/smart_pointer_inherit.i index a81d72268..52df5a92b 100644 --- a/Examples/test-suite/smart_pointer_inherit.i +++ b/Examples/test-suite/smart_pointer_inherit.i @@ -47,6 +47,7 @@ %inline %{ class ItkLevelSetNodeUS2 { + int x; }; %} diff --git a/Examples/test-suite/std_containers.i b/Examples/test-suite/std_containers.i index 0955226ad..ae69b6418 100644 --- a/Examples/test-suite/std_containers.i +++ b/Examples/test-suite/std_containers.i @@ -191,7 +191,8 @@ template struct Param struct Foo { - Foo(int i) { + int x; + Foo(int i) : x(i) { } }; diff --git a/Examples/test-suite/template_matrix.i b/Examples/test-suite/template_matrix.i index 27696542a..535193819 100644 --- a/Examples/test-suite/template_matrix.i +++ b/Examples/test-suite/template_matrix.i @@ -21,6 +21,7 @@ namespace simuPOP template class Operator { + int x; }; } diff --git a/Examples/test-suite/template_opaque.i b/Examples/test-suite/template_opaque.i index 5918fe069..b910e47e3 100644 --- a/Examples/test-suite/template_opaque.i +++ b/Examples/test-suite/template_opaque.i @@ -6,6 +6,7 @@ { struct OpaqueStruct { + int x; }; }