[all-commits] [llvm/llvm-project] ad14b5: [clang] Stop providing builtin overload candidate ...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Fri Jun 25 15:08:22 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad14b5b008e2f643cb989ec645f12bf26a8659bb
      https://github.com/llvm/llvm-project/commit/ad14b5b008e2f643cb989ec645f12bf26a8659bb
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2021-06-26 (Sat, 26 Jun 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/CXX/class/class.compare/class.spaceship/p2.cpp
    M clang/test/CXX/drs/dr15xx.cpp
    M clang/test/CXX/drs/dr3xx.cpp
    M clang/test/CXX/expr/expr.const/p2-0x.cpp
    M clang/test/FixIt/fixit.cpp
    M clang/test/Parser/cxx-template-argument.cpp
    M clang/test/Sema/compare.c
    M clang/test/SemaCXX/compare-cxx2a.cpp
    A clang/test/SemaCXX/compare-function-pointer.cpp
    M clang/test/SemaTemplate/resolve-single-template-id.cpp
    M compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cpp

  Log Message:
  -----------
  [clang] Stop providing builtin overload candidate for relational function pointer comparisons

Word on the grapevine was that the committee had some discussion that
ended with unanimous agreement on eliminating relational function pointer comparisons.

We wanted to be bold and just ban all of them cold turkey.
But then we chickened out at the last second and are going for
eliminating just the spaceship overload candidate instead, for now.

See D104680 for reference.

This should be fine and "safe", because the only possible semantic change this
would cause is that overload resolution could possibly be ambiguous if
there was another viable candidate equally as good.

But to save face a little we are going to:
* Issue an "error" for three-way comparisons on function pointers.
  But all this is doing really is changing one vague error message,
  from an "invalid operands to binary expression" into an
  "ordered comparison of function pointers", which sounds more like we mean business.
* Otherwise "warn" that comparing function pointers like that is totally
  not cool (unless we are told to keep quiet about this).

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D104892




More information about the All-commits mailing list