[all-commits] [llvm/llvm-project] 9381c6: [Clang][Sema] Use the correct injected template ar...

Krystian Stasiowski via All-commits all-commits at lists.llvm.org
Wed Oct 16 07:40:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9381c6fd04cc16a7606633f57c96c11e58181ddb
      https://github.com/llvm/llvm-project/commit/9381c6fd04cc16a7606633f57c96c11e58181ddb
  Author: Krystian Stasiowski <sdkrystian at gmail.com>
  Date:   2024-10-16 (Wed, 16 Oct 2024)

  Changed paths:
    M clang/include/clang/AST/DeclTemplate.h
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/CXX/temp/temp.constr/temp.constr.decl/p4.cpp

  Log Message:
  -----------
  [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (#112381)

After #111852 refactored multi-level template argument list collection,
the following results in a crash:
```
template<typename T, bool B>
struct A;

template<bool B>
struct A<int, B>
{
    void f() requires B;
};

template<bool B>
void A<int, B>::f() requires B { } // crash here
```

This happens because when collecting template arguments for constraint
normalization from a partial specialization, we incorrectly use the
template argument list of the partial specialization. We should be using
the template argument list of the _template-head_ (as defined in
[temp.arg.general] p2). Fixes #112222.



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