llvm-project/clang/www
Yuanfang Chen 340eac01f7 [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions
This implementation matches GCC behavior in that [[ https://eel.is/c++draft/temp.func.order#6.2.1 | temp.func.order p6.2.1 ]] is not implemented [1]. I reached out to the GCC author to confirm that some changes elsewhere to overload resolution are probably needed, but no solution has been developed sufficiently [3].

Most of the wordings are implemented straightforwardly. However,
for [[ https://eel.is/c++draft/temp.func.order#6.2.2 | temp.func.order p6.2.2 ]] "... or if the function parameters that positionally correspond between the two templates are not of the same type", the "same type" is not very clear ([2] is a bug related to this). Here is a quick example
```
template <C T, C U>        int f(T, U);
template <typename T, C U> int f(U, T);

int x = f(0, 0);
```
Is the `U` and `T` from different `f`s the "same type"? The answer is NO even though both `U` and `T` are deduced to be `int` in this case. The reason is that `U` and `T` are dependent types, according to [[ https://eel.is/c++draft/temp.over.link#3 |  temp.over.link p3 ]], they can not be the "same type".

To check if two function parameters are the "same type":
* For //function template//: compare the function parameter canonical types and return type between two function templates.
* For //class template/partial specialization//: by [[ https://eel.is/c++draft/temp.spec.partial.order#1.2 | temp.spec.partial.order p1.2 ]], compare the injected template arguments between two templates using hashing(TemplateArgument::Profile) is enough.

[1] https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=57b4daf8dc4ed7b669cc70638866ddb00f5b7746
[2] https://github.com/llvm/llvm-project/issues/49308
[3] https://lists.isocpp.org/core/2020/06/index.php#msg9392

Fixes https://github.com/llvm/llvm-project/issues/54039
Fixes https://github.com/llvm/llvm-project/issues/49308 (PR49964)

Reviewed By: royjacobson, #clang-language-wg, mizvekov

Differential Revision: https://reviews.llvm.org/D128750
2022-10-18 11:58:57 -07:00
..
analyzer Fixed a number of typos 2022-08-01 13:13:18 -04:00
demo Replace links to archived mailing lists by links to Discourse forums 2022-03-23 10:10:20 -04:00
OpenProjects.html
UniversalDriver.html
builtins.py
c_dr_status.html Update the status of a few more C99 DRs 2022-09-26 08:20:56 -04:00
c_status.html [C2x] Implement support for nullptr and nullptr_t 2022-10-14 10:06:02 -04:00
carbon-compile.png
clang_video-05-25-2007.html
clang_video-07-25-2007.html
compatibility.html
content.css
cxx_compatibility.html
cxx_dr_status.html [Clang] update cxx_dr_status.html by running make_cxx_dr_status 2022-10-18 11:45:40 -07:00
cxx_status.html [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions 2022-10-18 11:58:57 -07:00
diagnostics.html
favicon.ico
feature-compile1.png
feature-compile2.png
feature-memory1.png
features.html
get_involved.html Update references to Discourse instead of the mailing lists. 2022-07-08 11:16:47 -07:00
get_started.html [NFC] Suggest Release mode in clang GettingStarted.html 2022-06-10 11:00:05 +05:30
hacking.html [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
index.html
libstdc++4.4-clang0x.patch
libstdc++4.6-clang11.patch
libstdc++4.7-clang11.patch
make_cxx_dr_status [Clang] update cxx_dr_status.html by running make_cxx_dr_status 2022-10-18 11:45:40 -07:00
menu.css
menu.html.incl Replace links to archived mailing lists by links to Discourse forums 2022-03-23 10:10:20 -04:00
related.html [NFC] Inclusive language: Remove instances of master in URLs 2021-11-05 08:48:41 -05:00
robots.txt