[libcxx-commits] [PATCH] D96786: <ciso646> should provide defines for alternative operator representations

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 16 10:49:26 PST 2021

CaseyCarter added a comment.

In D96786#2565654 <https://reviews.llvm.org/D96786#2565654>, @ldionne wrote:

> In D96786#2565638 <https://reviews.llvm.org/D96786#2565638>, @mclow.lists wrote:
>> That  cppreference page you quote says:
>>> The same words are defined in the C programming language in the include file <iso646.h> as macros. Because in C++ these are built into the language, the C++ version of <iso646.h>, as well as <ciso646>, does not define anything.
> I agree with Marshall. I think the better approach here would be to file a bug against MSVC and ask them why they do not define the alternate operator representations as keywords in their compiler. If there's a good reason, we could go with your patch because it doesn't cost us much.

MSVC only recognizes the alternative tokens in strict (`/permissive-`) mode to avoid breaking legacy code that uses those lexemes as identifiers. I have no opinion on whether or not libc++ should accept this change, but I strongly recommend that C++ code that wants portable conformant behavior when compiling with MSVC should use `/permissive-`, which will finally be on-by-default in C++20 mode.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list