https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128508
Bug ID: 128508
Summary: [15/16 Regression] __is_invocable built-in doesn't
match std::invoke for pointer-to-member invoked with
array
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
#include <type_traits>
struct S { int i ; };
S s[1];
static_assert(std::is_invocable_v<int S::*, S(&)[1]>);
This used to compile OK using the library implementation of the trait, but
fails now that we use __is_invocable from the front-end:
inv.cc:4:20: error: static assertion failed
4 | static_assert(std::is_invocable_v<int S::*, S(&)[1]>);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 'int S::*' is not invocable by 'S (&)[1]', because
* error: first argument type 'S (&)[1]' of a pointer to member must be a
class type or a pointer to a class type