[all-commits] [llvm/llvm-project] acb767: [clang] fix profiling of template arguments of tem...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Tue Sep 6 09:28:17 PDT 2022


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

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/TemplateBase.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/test/SemaTemplate/concepts.cpp

  Log Message:
  -----------
  [clang] fix profiling of template arguments of template and declaration kind

Template arguments of template and declaration kind were being profiled
only by their canonical properties, which would cause incorrect
uniquing of constrained AutoTypes, leading to a crash in some cases.

This exposed some places in CheckTemplateArgumentList where non-canonical
arguments where being pushed into the resulting converted list.

We also throw in some asserts to catch early and explain the crashes.

Note that the fix for the 'declaration' kind is untestable at this point,
because there should be no cases right now in the AST where we try
to unique a non-canonical converted template argument.

This fixes GH55567.

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

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




More information about the All-commits mailing list