mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
Add comments explaining why no special casing of references is needed for *size_of.
This commit is contained in:
committed by
Marek Polacek
parent
b8d7f79a11
commit
d8e45233dd
@@ -3205,6 +3205,8 @@ eval_size_of (location_t loc, const constexpr_ctx *ctx, tree r,
|
||||
if (!complete_type_or_maybe_complain (type, NULL_TREE, tf_none))
|
||||
return throw_exception (loc, ctx, "reflection with incomplete type",
|
||||
fun, non_constant_p, jump_target);
|
||||
/* No special casing of references needed, c_sizeof_or_alignof_type returns
|
||||
the same size for POINTER_TYPE and REFERENCE_TYPE. */
|
||||
tree ret = c_sizeof_or_alignof_type (loc, type, true, false, 0);
|
||||
if (ret == error_mark_node)
|
||||
return throw_exception (loc, ctx, "reflection with incomplete type",
|
||||
@@ -3345,6 +3347,8 @@ eval_bit_size_of (location_t loc, const constexpr_ctx *ctx, tree r,
|
||||
if (!complete_type_or_maybe_complain (type, NULL_TREE, tf_none))
|
||||
return throw_exception (loc, ctx, "reflection with incomplete type",
|
||||
fun, non_constant_p, jump_target);
|
||||
/* No special casing of references needed, c_sizeof_or_alignof_type returns
|
||||
the same size for POINTER_TYPE and REFERENCE_TYPE. */
|
||||
tree ret = c_sizeof_or_alignof_type (loc, type, true, false, 0);
|
||||
if (ret == error_mark_node)
|
||||
return throw_exception (loc, ctx, "reflection with incomplete type",
|
||||
|
||||
Reference in New Issue
Block a user