[all-commits] [llvm/llvm-project] 869ac4: [Clang][Sema] Substitute for the type aliases insi...

Younan Zhang via All-commits all-commits at lists.llvm.org
Tue Jul 9 21:51:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 869ac4064861b7e644ae52a72fb80efacfd86462
      https://github.com/llvm/llvm-project/commit/869ac4064861b7e644ae52a72fb80efacfd86462
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Sema/Template.h
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/SemaTemplate/nested-deduction-guides.cpp

  Log Message:
  -----------
  [Clang][Sema] Substitute for the type aliases inside of a CTAD guide (#94740)

Similar to the approach of handling nested class templates when building
a CTAD guide, we substitute the template parameters of a type alias
declaration with the instantiating template arguments in order to ensure
the guide eventually doesn't reference any outer template parameters.

For example,
```cpp
template <class T> struct Outer {
  using Alias = S<T>;
  template <class U> struct Inner {
    Inner(Alias);
  };
};
```
we used to retain the reference to T accidentally because the
TreeTransform does nothing on type alias Decls by default.

Fixes https://github.com/llvm/llvm-project/issues/94614



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