[all-commits] [llvm/llvm-project] 63d51f: [clang] Implement CWG2398 provisional TTP matching...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Mon Jul 29 20:50:34 PDT 2024


  Branch: refs/heads/users/mizvekov/clang-cwg2398-ttp-matches-class-template
  Home:   https://github.com/llvm/llvm-project
  Commit: 63d51f7c1d3d810bd536313dd2ea3ba204b82c1e
      https://github.com/llvm/llvm-project/commit/63d51f7c1d3d810bd536313dd2ea3ba204b82c1e
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2024-07-30 (Tue, 30 Jul 2024)

  Changed paths:
    M clang-tools-extra/clangd/DumpAST.cpp
    M clang-tools-extra/clangd/SemanticHighlighting.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/ASTImporter.h
    M clang/include/clang/AST/DependenceFlags.h
    M clang/include/clang/AST/PropertiesBase.td
    M clang/include/clang/AST/TemplateName.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTDiagnostic.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/ODRHash.cpp
    M clang/lib/AST/TemplateName.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/AST/TypePrinter.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/SemaTemplate/cwg2398.cpp
    M clang/tools/libclang/CIndex.cpp

  Log Message:
  -----------
  [clang] Implement CWG2398 provisional TTP matching to class templates

This extends default argument deduction to cover class templates as
well.

This solves some ambuguity introduced in P0522 regarding how
template template parameters are partially ordered, and should reduce
the negative impact of enabling `-frelaxed-template-template-args`
by default.

Given the following example:
```C++
template <class T1, class T2 = float> struct A;
template <class T3> struct B;

template <template <class T4> class TT1, class T5> struct B<TT1<T5>>;   // #1
template <class T6, class T7>                      struct B<A<T6, T7>>; // #2

template struct B<A<int>>;
```
Prior to P0522, `#2` was picked. Afterwards, this became ambiguous.
This patch restores the pre-P0522 behavior, `#2` is picked again.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list