Re: [PATCH v2] c++: Adjust constexpr covariant call results [PR126324]

Jason Merrill <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
On 7/26/26 5:15 PM, Odysseas Georgoudis wrote:
> Hi Jason,
> 
> Thanks for catching the non-zero-offset case.
> In v2, the result-thunk path now preserves null pointers,
> evaluates the call only once, and adjusts the result to
> the thunk’s static return type.
> 
> The test covers both zero- and non-zero-offset bases.
Looks good, just a few tweaks.

> pointers, evaluate the call only once, and give the result the thunk's static
> 	* constexpr.cc (cxx_eval_thunk_call): Preserve null pointer results and
These lines are too long; the commit message should wrap at column 76 to 
accommodate 'git log' adding 4 spaces on the left.

> 	* g++.dg/cpp2a/pr126324.C: New test.

Let's add "constexpr-virtual" to the filename, i.e. 
constexpr-virtual-pr126324.C

> +      && scalarish_type_p (TREE_TYPE (t))

Let's use INDIRECT_TYPE_P since a covariant return type will be pointer 
or reference.  Or drop this line entirely; is it needed?

> +      && !same_type_ignoring_top_level_qualifiers_p
> +	   (TREE_TYPE (result), TREE_TYPE (t)))

This needs another set of parens starting either before or after the ! 
to prevent emacs from moving the args to line up with the &&.

Jason
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.