You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/c++/v1/numeric:554:52: error: arithmetic on pointers to the function type 'int ()'
return __a + _VSTD::midpoint(ptrdiff_t(0), __b - __a);
~~~ ^ ~~~
According to N4810, std::midpoint for T* should be constrained to require T to be a complete object type (not a function type, and not cv void either).
I'm fairly confident that no library code should ever try to constrain on is_pointer without also asking whether it's an object pointer, function pointer, member pointer, or void pointer. It might be worth auditing the entire libc++ codebase for uses of is_pointer.
The text was updated successfully, but these errors were encountered:
Extended Description
// https://godbolt.org/z/mAL4Sd
#include
int a();
int b();
int main() {
std::midpoint(a, b);
}
====
/c++/v1/numeric:554:52: error: arithmetic on pointers to the function type 'int ()'
return __a + _VSTD::midpoint(ptrdiff_t(0), __b - __a);
~~~ ^ ~~~
According to N4810, std::midpoint for
T*
should be constrained to requireT
to be a complete object type (not a function type, and not cv void either).I'm fairly confident that no library code should ever try to constrain on
is_pointer
without also asking whether it's an object pointer, function pointer, member pointer, or void pointer. It might be worth auditing the entire libc++ codebase for uses ofis_pointer
.The text was updated successfully, but these errors were encountered: