[libcxx-commits] [libcxx] [libc++] Properly decay functions in CTAD for `pair` (PR #134544)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 15 18:39:36 PDT 2025


================
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++17
+
+// <utility>
+
+// template<class T1, class T2>
+//   pair(T1, T2) -> pair<T1, T2>;
+
+// Test that the explicit deduction guide for std::pair correctly decays function lvalues and
+// behaves different from std::make_pair.
+
+#include <cassert>
+#include <functional>
+#include <type_traits>
+#include <utility>
+
+#include "test_macros.h"
+
+void dummy() {}
+
----------------
frederick-vs-ja wrote:

I think the first case in this test file is exactly for that GitHub issue. Did you mean adding a URL?

https://github.com/llvm/llvm-project/pull/134544


More information about the libcxx-commits mailing list