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.
This commit is contained in:
Jason Merrill 2020-09-18 15:34:24 -04:00
parent 04dc198ce5
commit e1a1808cd1

View 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. */