https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/222944
Fixes #38721 (Clang 18) Fixes #58682 (Clang 18) >From 1039f705f6fa0f257532fefe723a5f66f8281f4f Mon Sep 17 00:00:00 2001 From: Corentin Jabot <[email protected]> Date: Fri, 11 Sep 2026 15:19:05 +0200 Subject: [PATCH] [Clang][NFC] Add regression tests for a couple resolved issues Fixes #38721 (Clang 18) Fixes #58682 (Clang 18) --- .../SemaTemplate/temp_arg_nontype_cxx1z.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp index 9c25e26f43c36..2ab39ee9e13bf 100644 --- a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp +++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp @@ -626,3 +626,24 @@ namespace GH118190 { template <auto> int x; template <int i> int x<i>; } + +namespace GH38721 { + template <bool, decltype(auto)> struct A { static constexpr int k = 0; }; + template <decltype(auto) v> struct A<true, v> { static constexpr int k = 1; }; + + const double d = 10.0; + static_assert(A<true, 1>::k == 1, ""); + static_assert(A<true, (d)>::k == 1, ""); +} // namespace GH38721 + +namespace GH58682 { + template <decltype(auto) v> struct A {}; + template <decltype(auto) v> constexpr decltype(v) get(A<v>) { return v; } + + int g; + static_assert(&get(A<(g)>{}) == &g, ""); + + template <typename> struct B; + template <decltype(auto) v> struct B<A<v>> { static constexpr int k = 1; }; + static_assert(B<A<(g)>>::k == 1, ""); +} // namespace GH58682 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
