[clang] [Clang][NFC] Re-enable alias-template lambda constraint test (PR #233203)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 18 01:39:07 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Macro Terra (hongtaihu)
<details>
<summary>Changes</summary>
The T16 example in `clang/test/SemaTemplate/alias-template-with-lambdas.cpp` was left under `#if 0` in b412ec5d3924. That example no longer crashes, and the static_assert passes without extra diagnostics.
Remove the FIXME and compile the example.
No compiler behavior changes.
Verified with an assertions `clang -cc1 -std=c++2c -fsyntax-only -verify` on the patched file. The same example also passes on an assertions build of 34ba34d7f9bd, which does not include the local branch commits.
Assisted by Codex
---
Full diff: https://github.com/llvm/llvm-project/pull/233203.diff
1 Files Affected:
- (modified) clang/test/SemaTemplate/alias-template-with-lambdas.cpp (-4)
``````````diff
diff --git a/clang/test/SemaTemplate/alias-template-with-lambdas.cpp b/clang/test/SemaTemplate/alias-template-with-lambdas.cpp
index 5ec93163e4d188..7a0fd525be05c5 100644
--- a/clang/test/SemaTemplate/alias-template-with-lambdas.cpp
+++ b/clang/test/SemaTemplate/alias-template-with-lambdas.cpp
@@ -102,15 +102,11 @@ template <typename T> using T15 = T14<T, T>;
static_assert(__is_same(T15<char>, int));
-// FIXME: This still crashes because we can't extract template arguments T and U
-// outside of the instantiation context of T16.
-#if 0
template <typename T, typename... U>
using T16 = decltype([](auto Param) requires (sizeof(Param) != 1 && sizeof...(U) > 0) {
return Value<T, U...> + sizeof(Param);
});
static_assert(T16<int, char, float>()(42) == 2 + sizeof(42));
-#endif
} // namespace GH82104
namespace GH89853 {
``````````
</details>
https://github.com/llvm/llvm-project/pull/233203
More information about the cfe-commits
mailing list