Boost logo

Boost :

Subject: Re: [boost] [exception] [shared_ptr] ADL problem with msvc 10
From: Beman Dawes (bdawes_at_[hidden])
Date: 2010-04-19 09:50:37


On Sat, Apr 17, 2010 at 3:42 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
> Steven Watanabe:
>
>> I think that the compiler is correct to find the global f, but I don't
>> think
>> it should cause the static f to be hidden.
>>
>> 3.4.2 "When an unqualified name is used as the postfix-expression in a
>> function call..."
>
> Look further in 3.4.2/3:
>
> Let X be the lookup set produced by unqualified lookup (3.4.1) and let Y be
> the lookup set produced by
> argument dependent lookup (defined as follows). If X contains
> - a declaration of a class member, or
> - a block-scope function declaration that is not a using-declaration, or
> - a declaration that is neither a function or a function template
> then Y is empty.
>
> X contains f, a class member, even if it's a static class member.
>
>> -    enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes)
>> };
>> +    enum _vt { value = sizeof( (f)( static_cast<Y*>(0) ) ) == sizeof(yes)
>> };
>
> Yes, this works. No objections.

Is this a request for Steven to apply the patch:-?

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk