[all-commits] [llvm/llvm-project] 3f505c: [libc] Mark operator== const to avoid ambiguity in...

Samira Bazuzi via All-commits all-commits at lists.llvm.org
Thu Nov 30 08:22:24 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f505cd58776fca59f4f2eb456b169fa5da09317
      https://github.com/llvm/llvm-project/commit/3f505cd58776fca59f4f2eb456b169fa5da09317
  Author: Samira Bazuzi <bazuzi at users.noreply.github.com>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

  Changed paths:
    M libc/src/__support/CPP/bitset.h

  Log Message:
  -----------
  [libc] Mark operator== const to avoid ambiguity in C++20. (#73954)

C++20 will automatically generate an operator== with reversed operand
order, which is ambiguous with the written operator== when one argument
is marked const and the other isn't.

This operator currently triggers -Wambiguous-reversed-operator at
several usage sites in libc/test/src/__support/CPP/bitset_test.cpp,
starting with line 153.




More information about the All-commits mailing list