summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-03-06 14:21:12 +1300
committerOlly Betts <olly@survex.com>2022-03-06 14:21:12 +1300
commit6d29260a1a41deb4f9db38401e9f37000573d9ad (patch)
treeb82cd8f517c2996445032c8e83fae673263f897e
parent735732d721ea18a34013cea43b1a8951408f9fc9 (diff)
downloadswig-6d29260a1a41deb4f9db38401e9f37000573d9ad.tar.gz
Eliminate C++11 from constant_expr test
This was introduced by a recent commit adding a testcase matching an example in the manual. There doesn't seem to be a suitable termplate in the standard library before C++11, so instead use a dummy version of std::array defined in the testcase.
-rw-r--r--Examples/test-suite/constant_expr.i13
1 files changed, 10 insertions, 3 deletions
diff --git a/Examples/test-suite/constant_expr.i b/Examples/test-suite/constant_expr.i
index 43612b90b..a5ba5c6dd 100644
--- a/Examples/test-suite/constant_expr.i
+++ b/Examples/test-suite/constant_expr.i
@@ -23,8 +23,15 @@ isPointer = false
int a;
int test2(int b = 9%a) { return b; }
-/* Example from manual. */
-#include <array>
-void bar(std::array<int, (1<2? 100 : 50)> *x) { }
+/* Example from manual, adapted to avoid C++11 requirement. */
+namespace fakestd {
+ template<typename T, unsigned N>
+ class array {
+ T a[N];
+ public:
+ array() {}
+ };
+}
+void bar(fakestd::array<int, (1<2? 100 : 50)> *x) { }
%}