[cfe-users] Final C++20 rules and -Wambiguous-reversed-operator

Romain GEISSLER via cfe-users cfe-users at lists.llvm.org
Thu Mar 12 06:44:02 PDT 2020


Hi,

It looks like the working of C++20 introduced some breaking compatibilities with some C++17 accepted patterns. From what I read in https://reviews.llvm.org/rL375306 these incompatibilities weren’t really intented by the initial C++20 proposal, and thus broken patterns were still allowed as an extension, but would warn with -Wambiguous-reversed-operator enabled by default. Richard Smith had some hope that the C++20 standard would be fixed before being final.

C++20 is not fully finalized yet, but this date is approaching. What’s the state of the standard now ? Have the comparison issues been fixed ? If not, what do you suggest to users ? Fix the code (when it’s actually possible and make sense), or compile with -Wno-ambiguous-reversed-operator ? I am asking this question in the particular case of boost date_time: https://github.com/boostorg/date_time/issues/132 where I am actually unsure this is a good idea to change the existing code.

Cheers,
Romain


More information about the cfe-users mailing list