https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
--- Comment #1 from Andrew Pinski ---
Here is a C++14 testcase too:
template
auto f(T a) -> decltype(a+1) { return a+1; }
template
auto f(T a) {return a;}
struct Incomplete *p;
auto b = f(p);
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
--- Comment #2 from Andrew Pinski ---
#0 cxx_incomplete_type_diagnostic (loc=2147483649, value=,
type=, diag_kind=DK_ERROR) at
/home/apinski/src/upstream-gcc/gcc/gcc/cp/typeck2.c:311
#1 0x00f384bb in cxx_incomplete_type_error (loc=2147
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
--- Comment #3 from Andrew Pinski ---
I think the right patch is to check to see if the pointed to type is complete
in pointer_int_sum before calling size_in_bytes_loc. But there is no function
call that is common between the C and C++ front-end
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
Patrick Palka changed:
What|Removed |Added
Last reconfirmed||2021-12-22
Target Milestone|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
--- Comment #4 from Patrick Palka ---
(In reply to Andrew Pinski from comment #3)
> I think the right patch is to check to see if the pointed to type is
> complete in pointer_int_sum before calling size_in_bytes_loc. But there is
> no function c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
--- Comment #5 from Andrew Pinski ---
(In reply to Patrick Palka from comment #4)
> Hmm, can't we just check COMPLETE_TYPE_P in pointer_int_sum directly? Patch
> to that effect posted at
> https://gcc.gnu.org/pipermail/gcc-patches/2021-December
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
--- Comment #6 from CVS Commits ---
The master branch has been updated by Patrick Palka :
https://gcc.gnu.org/g:88cdcb5c18d73bfc9960d774c678f0e8103b8031
commit r12-6123-g88cdcb5c18d73bfc9960d774c678f0e8103b8031
Author: Patrick Palka
Date: M
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700
Patrick Palka changed:
What|Removed |Added
Target Milestone|11.3|12.0
Resolution|---