https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106016
--- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> --- (In reply to Segher Boessenkool from comment #3) > Yeah. It should just return 1 like the other scalar types? So the code did look for OPAQUE_TYPE and expected never to see it, so it was on an error path. I agree with your comment above and I'm guessing we want something like: diff --git a/gcc/expr.cc b/gcc/expr.cc index 78c839ab425..1675198a146 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -6423,13 +6423,13 @@ count_type_elements (const_tree type, bool for_ctor_p) case OFFSET_TYPE: case REFERENCE_TYPE: case NULLPTR_TYPE: + case OPAQUE_TYPE: return 1; case ERROR_MARK: return 0; case VOID_TYPE: - case OPAQUE_TYPE: case METHOD_TYPE: case FUNCTION_TYPE: case LANG_TYPE: