[all-commits] [llvm/llvm-project] 37b4df: [Clang] Remove the wrong assumption when rebuildin...

Younan Zhang via All-commits all-commits at lists.llvm.org
Thu Nov 7 22:05:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37b4df434d2cf82feb3672eeeb469e54ee8f7ff2
      https://github.com/llvm/llvm-project/commit/37b4df434d2cf82feb3672eeeb469e54ee8f7ff2
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-11-08 (Fri, 08 Nov 2024)

  Changed paths:
    M clang/include/clang/AST/ExprCXX.h
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/SemaTemplate/concepts-out-of-line-def.cpp

  Log Message:
  -----------
  [Clang] Remove the wrong assumption when rebuilding SizeOfPackExprs for constraint normalization (#115120)

In 463a4f150, we assumed that all the template argument packs are of
size 1 when normalizing a constraint expression because I mistakenly
thought those packs were obtained from their injected template
parameters. This was wrong because we might be checking constraints when
instantiating a friend declaration within a class template
specialization, where the parent class template is specialized with
non-dependent template arguments.

In that sense, we shouldn't assume any pack size nor expand anything in
such a scenario. Moreover, there are no intermediate (substituted but
unexpanded) AST nodes for template template parameters, so we have to
special-case their transformations by looking into the instantiation
scope instead of extracting anything from template arguments.

Fixes #115098



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