llvm-project/clang/test/CXX
Matheus Izvekov ad14b5b008 [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@gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D104892
2021-06-26 00:08:02 +02:00
..
basic [Sema] Fold VLAs to constant arrays in a few more contexts 2020-12-04 10:03:23 -05:00
class [clang] Stop providing builtin overload candidate for relational function pointer comparisons 2021-06-26 00:08:02 +02:00
class.access Remove redundant check for access in the conversion from the naming 2020-11-29 19:21:59 -08:00
class.derived Defer checking for mismatches between the deletedness of and overriding 2020-03-12 13:07:22 -07:00
conv [Sema][C++] Propagate conversion kind to specialize the diagnostics 2020-02-25 16:05:37 +00:00
cpp [Clang] Add __STDCPP_THREADS__ to standard predefine macros 2020-11-22 16:05:53 -08:00
dcl [clang] Fix ICE on invalid type parameters for concepts 2021-03-13 01:23:02 +01:00
dcl.dcl [clang] Implement P2266 Simpler implicit move 2021-06-18 17:08:59 +02:00
dcl.decl Remove unnecessary triple from test 2021-06-15 09:49:45 -07:00
drs [clang] Stop providing builtin overload candidate for relational function pointer comparisons 2021-06-26 00:08:02 +02:00
except [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer 2020-11-16 17:39:17 -08:00
expr [clang] Stop providing builtin overload candidate for relational function pointer comparisons 2021-06-26 00:08:02 +02:00
lex Add type information to integral template argument if required. 2021-05-12 19:00:08 +00:00
module Improve diagnostics for missing import / #include of module. 2020-04-28 18:41:14 -07:00
modules-ts Fix a diagnoses-valid bug with using declarations 2021-06-04 15:52:07 -04:00
over [c++20] Further extend the set of comparisons broken by C++20 that we 2020-03-20 14:22:48 -07:00
special [clang] tests: cleanup, update and add some new ones 2021-04-09 17:24:08 +02:00
stmt.stmt Add diagnostic for for-range-declaration being specificed with thread_local 2020-12-04 15:06:35 -08:00
temp [clang] Implement P2266 Simpler implicit move 2021-06-18 17:08:59 +02:00