https://github.com/MishkaSimakov created https://github.com/llvm/llvm-project/pull/224605
Added a regression test for https://github.com/llvm/llvm-project/issues/111378 in `SemaCXX/constant-expression-cxx11.cpp`. The bug itself was fixed in the commit `dc28f9d087324f77db81e7192648a17ebf036125` which addressed a different issue. Verified that the test passes now, and that it fails on commit `eebb50afaf27961b21847950179febdd20a98866` (previous to the bug fix commit). Also verified that the test fails when removing the fix from the current version of the code. >From 6e64d8611e15f65a1ab53bf2c39b6d9f7c1375a0 Mon Sep 17 00:00:00 2001 From: MishkaSimakov <[email protected]> Date: Fri, 18 Sep 2026 14:10:42 +0300 Subject: [PATCH] [clang] Add regression test for issue 111378 --- clang/test/SemaCXX/constant-expression-cxx11.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp index 7b483a4238652..6e41bb98f1805 100644 --- a/clang/test/SemaCXX/constant-expression-cxx11.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp @@ -2747,3 +2747,11 @@ namespace GH154567 { constexpr S s{}; static_assert(s.val.i == 0, ""); } + +namespace GH111378 { + void f() { + int &b = 0; + // expected-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} + auto &&L = [&]() { return b; }; + } +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
