https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101239
Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arthur.j.odwyer at gmail dot
com
--- Comment #4 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> ---
I believe I just hit this as well. Here's a C++20 reproducer:
auto f(auto a) -> decltype(a+1) { return a+1; }
struct Incomplete *p;
auto b = f(p);
The problem seems to be something about over-eager hard-erroring on pointer
arithmetic with incomplete types, because GCC also rejects this valid code:
auto f(auto a) requires requires { a+1; } { return a+1; }
auto f(auto a) { return a; }
struct Incomplete *p;
auto b = f(p);
(Should call the unconstrained overload; but GCC hard-errors instead.)