r251738 - [MSVC Compat] Permit conversions from pointer-to-function to pointer-to-object iff -fms-compatibility

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 1 07:21:45 PST 2015


On Sun, Nov 1, 2015 at 12:01 AM, James Dennett <jdennett at googlers.com>
wrote:

> On Sat, Oct 31, 2015 at 5:50 PM, Nico Weber via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> I think we more commonly say "function pointer":
>>
>> $ grep 'pointer-to-function' include/clang/Basic/Diagnostic*td | wc -l
>>        3
>> $ grep 'function pointer' include/clang/Basic/Diagnostic*td | wc -l
>>        7
>>
>> For "object pointer" and "pointer-to-object" it's currently a tie. For
>> "member pointer" and "pointer-to-member", the former is more common too. We
>> should probably make all of these consistent – any preferences? "foo
>> pointer" reads easier to me than "pointer-to-foo", but I'm not a native
>> speaker.
>>
>
> The C++ Standard has some unfortunate terminology here:
>
>    1.
>
>    The type of a pointer to void or a pointer to an object type is called
>    an object pointer type. [ Note: A pointer to void does not have a
>    pointer-to-object type, however, because void is not an object type. —
>    end note ]
>
> That makes standardizing on either problematic, because they have
> different meanings (any pointer-to-object type is an object pointer type,
> but not vice versa).
>

That distinction is probably lost on 99% of clang users though – in
general, I think clang tries to not use standardese in its diagnostics too
much (there are e.g. 0 diagnostics that mention either of prvalue, xvalue,
glvalue).

Also, since this diagnostic here talks about conversion of function
pointers to void pointers, "pointer-to-object" looks like the wrong term to
use in this case even if we tried to stick with the standard's wording,
right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151101/b76f3507/attachment.html>


More information about the cfe-commits mailing list