[clang] 309d1d7 - [clang][NFC] Add regression test for issue 111378 (#224605)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 30 06:05:28 PDT 2026
Author: MishkaSimakov
Date: 2026-09-30T13:05:19Z
New Revision: 309d1d7efc0e6edd858aeeebda24f479de6c7ae4
URL: https://github.com/llvm/llvm-project/commit/309d1d7efc0e6edd858aeeebda24f479de6c7ae4
DIFF: https://github.com/llvm/llvm-project/commit/309d1d7efc0e6edd858aeeebda24f479de6c7ae4.diff
LOG: [clang][NFC] Add regression test for issue 111378 (#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.
Fixes #111378
Added:
Modified:
clang/test/SemaCXX/constant-expression-cxx11.cpp
Removed:
################################################################################
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 at -1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}}
+ auto &&L = [&]() { return b; };
+ }
+}
More information about the cfe-commits
mailing list