From 86d8e0c0652ef5236a460b75c25e4f7093cc0651 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 1 Apr 2022 09:01:30 -0400 Subject: Revert "c++: delayed parse DMI [PR96645]" The breakage from r12-7804 (in WebKit, particularly) is more of a can of worms than I think we can address in GCC 12, so let's return to the GCC 11 status quo for now and try again in stage 1. I think the change was correct for the current standard, but the standard needs a fix in this area; this is CWG issue 2335. PR c++/96645 This reverts commits r12-7804 and r12-7929. --- gcc/cp/class.cc | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'gcc/cp/class.cc') diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index c75b889..40e1714 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -5415,11 +5415,10 @@ type_has_user_provided_or_explicit_constructor (tree t) /* Returns true iff class T has a non-user-provided (i.e. implicitly declared or explicitly defaulted in the class body) default - constructor. If SYNTH, only return true if it hasn't been - implicitly defined yet. */ + constructor. */ -static bool -type_has_non_user_provided_default_constructor_1 (tree t, bool synth) +bool +type_has_non_user_provided_default_constructor (tree t) { if (!TYPE_HAS_DEFAULT_CONSTRUCTOR (t)) return false; @@ -5432,28 +5431,12 @@ type_has_non_user_provided_default_constructor_1 (tree t, bool synth) if (TREE_CODE (fn) == FUNCTION_DECL && default_ctor_p (fn) && !user_provided_p (fn)) - { - if (synth) - return !DECL_INITIAL (fn); - return true; - } + return true; } return false; } -bool -type_has_non_user_provided_default_constructor (tree t) -{ - return type_has_non_user_provided_default_constructor_1 (t, false); -} - -bool -type_has_default_ctor_to_be_synthesized (tree t) -{ - return type_has_non_user_provided_default_constructor_1 (t, true); -} - /* TYPE is being used as a virtual base, and has a non-trivial move assignment. Return true if this is due to there being a user-provided move assignment in TYPE or one of its subobjects; if there isn't, then -- cgit v1.1