https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95328
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8efa945b308307fd9b0313705f5826a8499de405 commit r9-8900-g8efa945b308307fd9b0313705f5826a8499de405 Author: Jakub Jelinek <ja...@redhat.com> Date: Thu May 28 23:40:54 2020 +0200 c++: Try to complete decomp types [PR95328] Two years ago Paolo has added the else if (processing_template_decl && !COMPLETE_TYPE_P (type)) pedwarn (...); lines into cp_finish_decomp. For type dependent decl we punt much earlier, but even for types which aren't type dependent COMPLETE_TYPE_P might be false as this testcase shows, so this patch tries to complete_type first (the reason for writing it that way is that it is then followed by another else if and if complete_type returns error_mark_node, we shouldn't report anything, as a bug should have been reported already. 2020-05-28 Jakub Jelinek <ja...@redhat.com> PR c++/95328 * decl.c (cp_finish_decomp): Call complete_type before checking COMPLETE_TYPE_P. * g++.dg/cpp1z/decomp53.C: New test. (cherry picked from commit 3d8d5ddb539a5254c7ef83414377f4c74c7701d4)