https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55722

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-10-23
     Ever confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The diagnostics have changed since GCC 8, so that the ONLY_ONE case no longer
stops after the failed static_assert (which seems like a regression to me):

55722.cc: In instantiation of ‘struct
__assert_callable<std::integral_constant<bool, false> >’:
55722.cc:54:41:   required from ‘void call(_Callable&&, _Args&& ...) [with
_Callable = void (&)(int&); _Args = {}]’
55722.cc:62:9:   required from here
55722.cc:28:19: error: static assertion failed: Invalid arguments for callable
type
     static_assert(_Callable::value, "Invalid arguments for callable type");
                   ^~~~~~~~~
55722.cc: In instantiation of ‘decltype (__check_callable<_Callable, _Args
...>(0)) __bind_simple(_Callable&&, _Args&& ...) [with _Callable = void
(&)(int&); _Args = {}; decltype (__check_callable<_Callable, _Args ...>(0)) =
__assert_callable<std::integral_constant<bool, false> >]’:
55722.cc:54:41:   required from ‘void call(_Callable&&, _Args&& ...) [with
_Callable = void (&)(int&); _Args = {}]’
55722.cc:62:9:   required from here
55722.cc:47:96: error: could not convert ‘_Bind_simple<void (*())(int&)>((* &
std::forward<void (&)(int&)>((* & __callable))))’ from ‘__bindexpr_type’ {aka
‘_Bind_simple<void (*())(int&)>’} to
‘__assert_callable<std::integral_constant<bool, false> >’
     return __bindexpr_type( std::forward<_Callable>(__callable),
std::forward<_Args>(__args)...);
                                                                               
                ^


When there's a second call the static_assert is only given once, but the "could
not convert" is given twice. So the bug is still present (either the
static_assert should stop compilation, or should produce a diagnostic message
every time it fails).

Reply via email to