Date: Thu, 27 Feb 2025 11:46:32 +0100
On 27/02/2025 01.19, Russell Shaw via Std-Discussion wrote:
> On 27/2/25 00:36, Andrew Schepler wrote:
>> On Wed, Feb 26, 2025 at 8:07 AM Russell Shaw via Std-Discussion <std-
>> discussion_at_[hidden] <mailto:std-discussion_at_[hidden]>> wrote:
>>
>> Hi,
>>
>> In [class.member.lookup], using g++, i get "error: request for member ‘x’ is
>> ambiguous" for 'f.x = 0;'
>>
>>
>> clang++ 19.1.0, icpx 2025.0.0, and MSVC 19 all compile it without errors or
>> warning, matching the Standard's requirements. A gcc bug report is already open:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77725 <https://gcc.gnu.org/
>> bugzilla/show_bug.cgi?id=77725>
>
> Hi,
>
> I don't like that the std says it's non-ambiguous.
>
> It's clearly ambiguous. How does it justify that it's not ?
The standard does not have to justify anything. It's a set of
rules; your implementation can be conforming (implementing all
the rules) or it can fail to do so.
> The wording 'is unambiguous because the A and B base class subobjects' seems to
> first appear in 2017/n4640.txt
The current set-based rules around member name lookup are due to
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1626.pdf
> Did clang++/icpx/MSVC change their lookup algorithm from prior to 2017 ?
If you wish to make a change to the rules, as specified in the standard,
please write a paper: https://isocpp.org/std/submit-a-proposal
And feel free to post a bug report for the compiler that is non-conforming here.
Jens
> On 27/2/25 00:36, Andrew Schepler wrote:
>> On Wed, Feb 26, 2025 at 8:07 AM Russell Shaw via Std-Discussion <std-
>> discussion_at_[hidden] <mailto:std-discussion_at_[hidden]>> wrote:
>>
>> Hi,
>>
>> In [class.member.lookup], using g++, i get "error: request for member ‘x’ is
>> ambiguous" for 'f.x = 0;'
>>
>>
>> clang++ 19.1.0, icpx 2025.0.0, and MSVC 19 all compile it without errors or
>> warning, matching the Standard's requirements. A gcc bug report is already open:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77725 <https://gcc.gnu.org/
>> bugzilla/show_bug.cgi?id=77725>
>
> Hi,
>
> I don't like that the std says it's non-ambiguous.
>
> It's clearly ambiguous. How does it justify that it's not ?
The standard does not have to justify anything. It's a set of
rules; your implementation can be conforming (implementing all
the rules) or it can fail to do so.
> The wording 'is unambiguous because the A and B base class subobjects' seems to
> first appear in 2017/n4640.txt
The current set-based rules around member name lookup are due to
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1626.pdf
> Did clang++/icpx/MSVC change their lookup algorithm from prior to 2017 ?
If you wish to make a change to the rules, as specified in the standard,
please write a paper: https://isocpp.org/std/submit-a-proposal
And feel free to post a bug report for the compiler that is non-conforming here.
Jens
Received on 2025-02-27 10:46:46