https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120049
--- Comment #28 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- I was also working on a patch as well and it occurred to me that we need the logic to go like this with a helper function: // helper function, possibly two arguments here for checking bool checkthearg (acptr) { if all good return true otherwise issue error and return false } if (cptr2) if (checkthearg (cptr2)) return checkthearg (cptr1) else return (checkthearg (cptr1) return false This approach can avoid the temporaries and goto errors etc. Greatly simplifies things.