From e1a1808cd19afd93fc4134fbd8376346d05bdba8 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 18 Sep 2020 15:34:24 -0400 Subject: [PATCH] c++: Fix bootstrap failure. [PR97118] gcc/cp/ChangeLog: PR bootstrap/97118 * decl.c (complete_vars): Only call layout_var_decl if completing the type succeeded. --- gcc/cp/decl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 746ed101fef..13f065d5058 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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. */ -- 2.30.2