[all-commits] [llvm/llvm-project] 74ce29: Revert "[Clang] Implement Change scope of lambda t...

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Fri Feb 3 08:49:49 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 74ce297045bac4bc475b8e762d2a1ea19bb16d3c
      https://github.com/llvm/llvm-project/commit/74ce297045bac4bc475b8e762d2a1ea19bb16d3c
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/Sema/Scope.h
    M clang/include/clang/Sema/ScopeInfo.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/lib/Sema/Scope.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaCXXScopeSpec.cpp
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaLambda.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
    R clang/test/SemaCXX/lambda-capture-type-deduction.cpp
    M clang/test/SemaCXX/warn-shadow-in-lambdas.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  Revert "[Clang] Implement Change scope of lambda trailing-return-type"

This reverts commit d708a186b6a9b050d09558163dd353d9f738c82d (and typo fix e4bc9898ddbeb70bc49d713bbf863f050f21e03f). It causes a compilation error for this:

```
struct StringLiteral {
  template <int N>
  StringLiteral(const char (&array)[N])
      __attribute__((enable_if(N > 0 && N == __builtin_strlen(array) + 1,
                               "invalid string literal")));
};

struct Message {
  Message(StringLiteral);
};

void Func1() {
  auto x = Message("x");  // Note: this is fine

  // Note: "xx\0" to force a different type, StringLiteral<3>, otherwise this
  // successfully builds.
  auto y = [&](decltype(Message("xx"))) {};

  // ^ fails with: repro.cc:18:13: error: reference to local variable 'array'
  // declared in enclosing function 'StringLiteral::StringLiteral<3>'

  (void)x;
  (void)y;
}
```

More details posted to D124351.




More information about the All-commits mailing list