[all-commits] [llvm/llvm-project] e78a1f: [Clang] Fix the instantiation of return type requi...

刘雨培 via All-commits all-commits at lists.llvm.org
Thu Jan 4 09:32:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e78a1f491cbc0a57de7bf86058359dd0bd282540
      https://github.com/llvm/llvm-project/commit/e78a1f491cbc0a57de7bf86058359dd0bd282540
  Author: 刘雨培 <liuyupei951018 at hotmail.com>
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/SemaTemplate/concepts-lambda.cpp

  Log Message:
  -----------
  [Clang] Fix the instantiation of return type requirements in lambda bodies (#76967)

Currently, due to the incomplete implementation of p0588r1, the
instantiation of lambda expressions leads to the instantiation of the
body. And `EvaluateConstraints` is false during the instantiation of the
body, which causes crashes during the instantiation of the return type
requirement:

```cpp
template<typename T> concept doesnt_matter = true;

template<class T>
concept test = 
    []{
        return requires(T t) {
            { t } -> doesnt_matter; // crash
        };
    }();

static_assert(test<int>);
```

Although a complete implementation of p0588r1 can solve these crashes,
it will take some time. Therefore, this pull request aims to fix these
crashes first.

Fixes https://github.com/llvm/llvm-project/issues/63808
Fixes https://github.com/llvm/llvm-project/issues/64607
Fixes https://github.com/llvm/llvm-project/issues/64086




More information about the All-commits mailing list