llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Corentin Jabot (cor3ntin) <details> <summary>Changes</summary> Fixes #<!-- -->38721 (Clang 18) Fixes #<!-- -->58682 (Clang 18) --- Full diff: https://github.com/llvm/llvm-project/pull/222944.diff 1 Files Affected: - (modified) clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp (+21) ``````````diff 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 `````````` </details> https://github.com/llvm/llvm-project/pull/222944 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
