summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Swig/typesys.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/Swig/typesys.c b/Source/Swig/typesys.c
index fc2224bf5..1d108dbde 100644
--- a/Source/Swig/typesys.c
+++ b/Source/Swig/typesys.c
@@ -1700,10 +1700,13 @@ void SwigType_remember_clientdata(const SwigType *t, const_String_or_char_ptr cl
if (t) {
char *ct = Char(t);
const char *lt = strchr(ct, '<');
- /* Allow for `<<` operator in constant expression for array size. */
- if (lt && lt[1] != '(' && lt[1] != '<') {
- Printf(stdout, "Bad template type passed to SwigType_remember: %s\n", t);
- assert(0);
+ if (lt && lt[1] != '(') {
+ /* We special case `<<` above, but most cases aren't handled, for example:
+ *
+ * unsigned char myarray[std::numeric_limits<unsigned char>::max()]; // #2486
+ */
+ Swig_error(Getfile(t), Getline(t), "Array size expressions containing a '<' character not fully supported");
+ Exit(EXIT_FAILURE);
}
}