Author: Corentin Jabot
Date: 2026-09-11T16:29:31+02:00
New Revision: f55cb17894f605f8045d74f7ed13322776530acc

URL: 
https://github.com/llvm/llvm-project/commit/f55cb17894f605f8045d74f7ed13322776530acc
DIFF: 
https://github.com/llvm/llvm-project/commit/f55cb17894f605f8045d74f7ed13322776530acc.diff

LOG: [Clang][NFC] Add regression tests for a couple resolved issues (#222944)

Fixes #38721 (Clang 18)
Fixes #58682 (Clang 18)

Added: 
    

Modified: 
    clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
index cede91cd41997..5077d5ff8ad89 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
@@ -627,3 +627,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

Reply via email to