[all-commits] [llvm/llvm-project] f4ea3b: [clang] Fixes how we represent / emulate builtin t...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Fri Sep 16 08:45:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f4ea3bd4b2086e6de10131b197aaf7d066a24df8
      https://github.com/llvm/llvm-project/commit/f4ea3bd4b2086e6de10131b197aaf7d066a24df8
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/DeclTemplate.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/test/SemaTemplate/make_integer_seq.cpp
    M clang/test/SemaTemplate/type_pack_element.cpp

  Log Message:
  -----------
  [clang] Fixes how we represent / emulate builtin templates

We change the template specialization of builtin templates to
behave like aliases.

Though unlike real alias templates, these might still produce a canonical
TemplateSpecializationType when some important argument is dependent.

For example, we can't do anything about make_integer_seq when the
count is dependent, or a type_pack_element when the index is dependent.

We change type deduction to not try to deduce canonical TSTs of
builtin templates.

We also change those buitin templates to produce substitution sugar,
just like a real instantiation would, making the resulting type correctly
represent the template arguments used to specialize the underlying template.

And make_integer_seq will now produce a TST for the specialization
of it's first argument, which we use as the underlying type of
the builtin alias.

When performing member access on the resulting type, it's now
possible to map from a Subst* node to the template argument
as-written used in a regular fashion, without special casing.

And this fixes a bunch of bugs with relation to these builtin
templates factoring into deduction.

Fixes GH42102 and GH51928.

Depends on D133261

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

Differential Revision: https://reviews.llvm.org/D133262




More information about the All-commits mailing list