DR2303: Prefer 'nearer' base classes during template deduction.
authorErich Keane <erich.keane@intel.com>
Fri, 17 Jul 2020 16:48:01 +0000 (09:48 -0700)
committerErich Keane <erich.keane@intel.com>
Fri, 31 Jul 2020 12:39:55 +0000 (05:39 -0700)
commite704aa4f254a26505d4bb9dc38bdee0ff4efa4ba
tree576aeda1c0645c0d0d0cdb0d2b4b10114bba3b69
parent638f0cf565f2121151c32d7eb52a1de0e333d5f6
DR2303: Prefer 'nearer' base classes during template deduction.

DR2303 fixes the case where the derived-base match for template
deduction is ambiguous if a base-of-base ALSO matches. The canonical
example (as shown in the test) is just like the MSVC implementation of
std::tuple.

This fixes a fairly sizable issue, where if a user inherits from
std::tuple on Windows (with the MS STL), they cannot use that type to
call a function that takes std::tuple.

Differential Revision: https://reviews.llvm.org/D84048
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/test/CXX/drs/dr23xx.cpp
clang/www/cxx_dr_status.html