@@ -25254,13 +25254,14 @@ that identifies an object or a prvalue that is a pointer to an object.
2525425254} /* examine_expr_for_auto_object */
2525525255
2525625256
25257- a_boolean is_glvalue_for_auto_object(an_expr_node_ptr expr,
25258- a_boolean *is_temp)
25257+ static a_boolean glvalue_for_auto_object(an_expr_node_ptr expr,
25258+ a_boolean follow_prvalues,
25259+ a_boolean *is_temp)
2525925260/*
25260- Return TRUE if expr is a glvalue whose underlying object is known to
25261- be an automatic (stack-based) entity . The safe answer is FALSE. If the
25262- underlying entity is a temporary, return *is_temp set to TRUE.
25263- is_temp can be NULL if that information is not needed .
25261+ Do the work for is_glvalue_for_auto_object and
25262+ is_glvalue_for_auto_object_or_temp_subobject . If follow_prvalues is TRUE,
25263+ the traversal continues through class prvalues, so that a subobject of a
25264+ temporary (e.g., "S().x") is found .
2526425265*/
2526525266{
2526625267 a_boolean is_auto_object = FALSE;
@@ -25271,14 +25272,41 @@ is_temp can be NULL if that information is not needed.
2527125272 clear_expr_or_stmt_traversal_block(&tblock);
2527225273 tblock.process_expr = examine_expr_for_auto_object;
2527325274 tblock.follow_addressing_path = TRUE;
25275+ tblock.follow_class_rvalue_addressing_path = follow_prvalues;
2527425276 traverse_expr(expr, &tblock);
2527525277 is_auto_object = tblock.result;
2527625278 if (is_temp != NULL) *is_temp = tblock.is_temp;
2527725279 } /* if */
2527825280 return is_auto_object;
25281+ } /* glvalue_for_auto_object */
25282+
25283+
25284+ a_boolean is_glvalue_for_auto_object(an_expr_node_ptr expr,
25285+ a_boolean *is_temp)
25286+ /*
25287+ Return TRUE if expr is a glvalue whose underlying object is known to
25288+ be an automatic (stack-based) entity. The safe answer is FALSE. If the
25289+ underlying entity is a temporary, return *is_temp set to TRUE.
25290+ is_temp can be NULL if that information is not needed.
25291+ */
25292+ {
25293+ return glvalue_for_auto_object(expr, /*follow_prvalues=*/FALSE, is_temp);
2527925294} /* is_glvalue_for_auto_object */
2528025295
2528125296
25297+ a_boolean is_glvalue_for_auto_object_or_temp_subobject(
25298+ an_expr_node_ptr expr,
25299+ a_boolean *is_temp)
25300+ /*
25301+ Like is_glvalue_for_auto_object, but also return TRUE (with *is_temp set to
25302+ TRUE) if expr is a glvalue for a subobject of a class prvalue temporary,
25303+ e.g., "S().x".
25304+ */
25305+ {
25306+ return glvalue_for_auto_object(expr, /*follow_prvalues=*/TRUE, is_temp);
25307+ } /* is_glvalue_for_auto_object_or_temp_subobject */
25308+
25309+
2528225310a_boolean is_prvalue_for_auto_object(an_expr_node_ptr expr,
2528325311 a_boolean *is_temp)
2528425312/*
0 commit comments