[all-commits] [llvm/llvm-project] a144bf: [Clang] Fix handling of brace ellison when buildin...

Younan Zhang via All-commits all-commits at lists.llvm.org
Thu Jun 13 02:47:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a144bf2b2511b47fc165755817eda17f79ef5476
      https://github.com/llvm/llvm-project/commit/a144bf2b2511b47fc165755817eda17f79ef5476
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-06-13 (Thu, 13 Jun 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/SemaTemplate/deduction-guide.cpp

  Log Message:
  -----------
  [Clang] Fix handling of brace ellison when building deduction guides (#94889)

Fixes two issues in two ways:

1) The `braced-init-list` consisted of `initializer-list` and
`designated-initializer-list`, and thus the designated initializer is
subject to [over.match.class.deduct]p1.8, which means the brace elision
is also applicable on it for CTAD deduction guides.

2) When forming a deduction guide where the brace elision is applicable,
we should also consider the presence of braces within the initializer.
For example, given

template <class T, class U> struct X {
  T t[2];
  U u[3];
};

X x = {{1, 2}, 3, 4, 5};

we should establish such deduction guide AFAIU: `X(T (&&)[2], U, U, U) -> X<T, U>`.

Fixes https://github.com/llvm/llvm-project/issues/64625
Fixes https://github.com/llvm/llvm-project/issues/83368



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