diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 1d5b09a68059c638c7c2d08bec5b7df01e262aaa..e71fd41f62d0cd92b58b29fed8dc39f3604c7ea5 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1930,6 +1930,8 @@ region_model::update_for_int_cst_return (const call_details &cd, { if (!cd.get_lhs_type ()) return; + if (TREE_CODE (cd.get_lhs_type ()) != INTEGER_TYPE) + return; const svalue *result = m_mgr->get_or_create_int_cst (cd.get_lhs_type (), retval); if (unmergeable) @@ -1955,6 +1957,8 @@ region_model::update_for_nonzero_return (const call_details &cd) { if (!cd.get_lhs_type ()) return; + if (TREE_CODE (cd.get_lhs_type ()) != INTEGER_TYPE) + return; const svalue *zero = m_mgr->get_or_create_int_cst (cd.get_lhs_type (), 0); const svalue *result diff --git a/gcc/testsuite/g++.dg/analyzer/fd-bind-pr107783.C b/gcc/testsuite/g++.dg/analyzer/fd-bind-pr107783.C new file mode 100644 index 0000000000000000000000000000000000000000..eb5e23c82cf1fcc154634359d886a459bb1500ce --- /dev/null +++ b/gcc/testsuite/g++.dg/analyzer/fd-bind-pr107783.C @@ -0,0 +1,11 @@ +// { dg-do compile { target c++11 } } + +struct minus { +} _1; +int _2; +struct _Bind { + _Bind(_Bind &); +}; +template <typename _Func, typename _BoundArgs> +_Bind bind(_Func, _BoundArgs &&...); +void test01() { bind(minus(), _2, _1); }