aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/class.cc6
-rw-r--r--gcc/cp/method.cc4
3 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 51672a7..764e158 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2025-05-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/120012
+ * class.cc (check_non_pod_aggregate): Check is_empty_class.
+
+2025-05-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/120204
+ * pt.cc (tsubst_baselink): Always error if lookup fails.
+
2025-05-09 Jason Merrill <jason@redhat.com>
* decl2.cc (determine_visibility): Ignore args for friend templates.
diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc
index 2764bb5..db39e57 100644
--- a/gcc/cp/class.cc
+++ b/gcc/cp/class.cc
@@ -6879,8 +6879,10 @@ check_non_pod_aggregate (tree field)
tree type = TREE_TYPE (field);
if (TYPE_IDENTIFIER (type) == as_base_identifier)
type = TYPE_CONTEXT (type);
- if (!CLASS_TYPE_P (type) || (!CLASSTYPE_NON_POD_AGGREGATE (type)
- && !CLASSTYPE_NON_AGGREGATE_POD (type)))
+ if (!CLASS_TYPE_P (type)
+ || is_empty_class (type)
+ || (!CLASSTYPE_NON_POD_AGGREGATE (type)
+ && !CLASSTYPE_NON_AGGREGATE_POD (type)))
return;
tree size = end_of_class (type, (DECL_FIELD_IS_BASE (field)
? eoc_nvsize : eoc_nv_or_dsize));
diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc
index 05c19cf..092bae2 100644
--- a/gcc/cp/method.cc
+++ b/gcc/cp/method.cc
@@ -2949,7 +2949,9 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
&& BINFO_VIRTUAL_P (base_binfo)
&& fn && TREE_CODE (fn) == FUNCTION_DECL
&& move_fn_p (fn) && !trivial_fn_p (fn)
- && vbase_has_user_provided_move_assign (BINFO_TYPE (base_binfo)))
+ && vbase_has_user_provided_move_assign (BINFO_TYPE (base_binfo))
+ && warning_enabled_at (DECL_SOURCE_LOCATION (fn),
+ OPT_Wvirtual_move_assign))
warning (OPT_Wvirtual_move_assign,
"defaulted move assignment for %qT calls a non-trivial "
"move assignment operator for virtual base %qT",