CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]  2023/03/26 03:09:31

Modified files:
        gnu/llvm/clang/include/clang/Basic: DiagnosticSemaKinds.td 
        gnu/llvm/clang/lib/Sema: SemaDeclCXX.cpp 

Log message:
allow out-of-class defaulting of comparison operators

ok deraadt@, mortimer@

this is backport of the following upstream commit:

commit 5fbe21a7748f91adbd1b16c95bbfe180642320a3
Author: Nathan Sidwell <[email protected]>
Date:   Wed Jun 16 10:43:43 2021 -0700

[clang] p2085 out-of-class comparison operator defaulting

This implements p2085, allowing out-of-class defaulting of comparison
operators, primarily so they need not be inline, IIUC intent. this was
mostly straigh forward, but required reimplementing
Sema::CheckExplicitlyDefaultedComparison, as now there's a case where
we have no a priori clue as to what class a defaulted comparison may
be for. We have to inspect the parameter types to find out. Eg:

class X { ... };
bool operator==(X, X) = default;

Thus reimplemented the parameter type checking, and added 'is this a
friend' functionality for the above case.

Reply via email to