From 86f437e3f66cab44d5814c49216320bb16ae6ecc Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 17 May 2023 18:05:42 +1200 Subject: Support parsing arbitrary expression in decltype Use parser error recovery to skip to the closing matching `)` and issue a warning that we can't deduce the decltype for the expression (like we already do for any expression which isn't a simple variable or similar). Fixes #1589 Helps #2335 (fixes the decltype-related examples) --- Examples/test-suite/cpp11_template_parameters_decltype.i | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Examples') diff --git a/Examples/test-suite/cpp11_template_parameters_decltype.i b/Examples/test-suite/cpp11_template_parameters_decltype.i index 1d00124f1..8528636d7 100644 --- a/Examples/test-suite/cpp11_template_parameters_decltype.i +++ b/Examples/test-suite/cpp11_template_parameters_decltype.i @@ -6,14 +6,12 @@ #pragma SWIG nowarn=SWIGWARN_CPP11_DECLTYPE -#if 0 // to fix (non-template expression equivalent to template expression further down): %inline %{ #include #include void f(bool c = std::is_constructible>>().begin()->first)>::value) {} %} -#endif %inline %{ // Github issue #1590 @@ -26,14 +24,11 @@ struct Json { Json(const T & t) : Json(t.to_json()) {} // Github issue #1589 -// To fix -#if !defined(SWIG) // Implicit constructor: map-like objects (std::map, std::unordered_map, etc) template ().begin()->first)>::value, int>::type = 0> Json(const M & m) : Json(object(m.begin(), m.end())) {} -#endif }; %} -- cgit v1.2.1 From 59794e710fb91ce41343ffed485f2652828bd1bf Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 18 May 2023 07:22:03 +1200 Subject: Update comment wrt #1589 --- Examples/test-suite/cpp11_template_parameters_decltype.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Examples') diff --git a/Examples/test-suite/cpp11_template_parameters_decltype.i b/Examples/test-suite/cpp11_template_parameters_decltype.i index 8528636d7..257d1ec8d 100644 --- a/Examples/test-suite/cpp11_template_parameters_decltype.i +++ b/Examples/test-suite/cpp11_template_parameters_decltype.i @@ -6,7 +6,7 @@ #pragma SWIG nowarn=SWIGWARN_CPP11_DECLTYPE -// to fix (non-template expression equivalent to template expression further down): +// Non-template expression equivalent to template expression further down: %inline %{ #include #include -- cgit v1.2.1