C++ Logo


Advanced search

What does this sentence in the definition of COMMON-REF mean?

From: Eric Schmidt <eric41293_at_[hidden]>
Date: Thu, 17 Nov 2022 20:45:34 -0800

The definition of COMMON-REF concludes with, "If any of the types
computed above is ill-formed, then COMMON-REF(A, B) is ill-formed."

I'm not sure what this means. My first inclination is that it means, if
the type formed for the particular case is ill-formed, then
COMMON-REF(A, B) is ill-formed. But this seems redundant with the
immediately preceding statement, "Otherwise, COMMON-REF(A, B) is

The other interpretation is that if the type of any of the four cases is
ill-formed, then COMMON-REF(A, B) is ill-formed even if a different case
applies. But it seems odd to me to say that, if X is A& and Y is B&,
that COMMON-REF(X, Y) is ill-formed if the type for the mixed rvalue and
lvalue reference case, namely, COMMON-REF(const A&, B&), is ill-formed.

Can anyone shed some light on this?

Received on 2022-11-18 04:46:06