summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.compare
Commit message (Collapse)AuthorAgeFilesLines
* PR44721: Don't consider overloaded operators for built-in comparisonsRichard Smith2020-02-041-0/+12
| | | | | | | | | | | | | | | | | | | | when building a defaulted comparison. As a convenient way of asking whether `x @ y` is valid and building it, we previouly always performed overload resolution and built an overloaded expression, which would both end up picking a builtin operator candidate when given a non-overloadable type. But that's not quite right, because it can result in our finding a user-declared operator overload, which we should never do when applying operators non-overloadable types. Handle this more correctly: skip overload resolution when building `x @ y` if the operands are not overloadable. But still perform overload resolution (considering only builtin candidates) when checking validity, as we don't have any other good way to ask whether a binary operator expression would be valid. (cherry picked from commit 1f3f8c369a5067a132c871f33a955a7feaea8534)
* PR44723: Trigger return type deduction for operator<=>s whose returnRichard Smith2020-01-311-0/+33
| | | | | | | | | | types are needed to compute the return type of a defaulted operator<=>. This raises the question of what to do if return type deduction fails. The standard doesn't say, and implementations vary, so for now reject that case eagerly to keep our options open. (cherry picked from commit 42d4a55f227a1cc78ab8071062d869abe88655d9)
* PR44627: Consider reversing == and <=> candidates found by ADL.Richard Smith2020-01-301-1/+1
| | | | (cherry picked from commit 1db66e705f4dbe7dbe17edac804289ef59d5f616)
* [Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2aSaar Raz2020-01-241-3/+2
| | | | | | | | | Now with concepts support merged and mostly complete, we do not need -fconcepts-ts (which was also misleading as we were not implementing the TS) and can enable concepts features under C++2a. A warning will be generated if users still attempt to use -fconcepts-ts. (cherry picked from commit 67c608a9695496cfc9d3fdf9d0b12b554ac6b4df)
* [c++20] Compute exception specifications for defaulted comparisons.Richard Smith2019-12-152-10/+10
| | | | | | | | This requires us to essentially fully form the body of the defaulted comparison, but from an unevaluated context. Naively this would require generating the function definition twice; instead, we ensure that the function body is implicitly defined before performing the check, and walk the actual body where possible.
* [c++20] Implement P1946R0: allow defaulted comparisons to take theirRichard Smith2019-12-102-4/+28
| | | | arguments by value.
* [c++20] Delete defaulted comparison functions if they would invoke anRichard Smith2019-12-103-0/+98
| | | | inaccessible comparison function.
* [c++20] Implement P1185R2 (as modified by P2002R0).Richard Smith2019-12-101-0/+146
| | | | | | For each defaulted operator<=> in a class that doesn't explicitly declare any operator==, also inject a matching implicit defaulted operator==.
* [c++20] Return type deduction for defaulted three-way comparisons.Richard Smith2019-12-101-0/+125
|
* [c++20] Fix handling of unqualified lookups from a defaulted comparisonRichard Smith2019-12-091-0/+76
| | | | | | | | | | function. We need to perform unqualified lookups from the context of a defaulted comparison, but not until we implicitly define the function, at which point we can't do those lookups any more. So perform the lookup from the end of the class containing the =default declaration and store the lookup results on the defaulted function until we synthesize the body.
* [c++20] Defaulted comparison support for array members.Richard Smith2019-12-095-37/+92
|
* [c++20] Synthesis of defaulted comparison functions.Richard Smith2019-12-087-20/+222
| | | | | | Array members are not yet handled. In addition, defaulted comparisons can't yet find comparison operators by unqualified lookup (only by member lookup and ADL). These issues will be fixed in follow-on changes.
* [c++20] Determine whether a defaulted comparison should be deleted orRichard Smith2019-12-067-47/+502
| | | | constexpr.
* [c++20] Enforce rule that a union-like class or class with referenceRichard Smith2019-10-271-0/+70
| | | | members cannot have defaulted comparisons.
* [c++2a] Allow comparison functions to be explicitly defaulted.Richard Smith2019-10-223-0/+96
This adds some initial syntactic checking that only the appropriate function signatures can be defaulted. No implicit definitions are generated yet.
OpenPOWER on IntegriCloud