c++: Fix bootstrap failure. [PR97118]
authorJason Merrill <jason@redhat.com>
Fri, 18 Sep 2020 19:34:24 +0000 (15:34 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 18 Sep 2020 19:35:26 +0000 (15:35 -0400)
gcc/cp/ChangeLog:

PR bootstrap/97118
* decl.c (complete_vars): Only call layout_var_decl if completing
the type succeeded.

gcc/cp/decl.c

index 746ed101fef9d241b77a42d9d6255546ec2376ee..13f065d5058cf319a604d26b493538380b56efa0 100644 (file)
@@ -17463,7 +17463,8 @@ complete_vars (tree type)
              /* Complete the type of the variable.  */
              complete_type (type);
              cp_apply_type_quals_to_decl (cp_type_quals (type), var);
-             layout_var_decl (var);
+             if (COMPLETE_TYPE_P (type))
+               layout_var_decl (var);
            }
 
          /* Remove this entry from the list.  */