[libcxx-commits] [libcxx] [libc++][test] Do not test Clang bug in `is_constructible.pass.cpp` (PR #105964)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 24 18:34:47 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: S. B. Tam (cpplearner)
<details>
<summary>Changes</summary>
A comment in `is_constructible.pass.cpp` suggests that Clang is non-conforming in accepting construction of `const int&` from `ExplicitTo<int&&>`.
https://github.com/llvm/llvm-project/blob/3ef64f7ab5b8651eab500cd944984379fce5f639/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp#L225-L229
This PR changes the test to expect the standard-conforming behavior, which makes the test pass on MSVC.
---
Full diff: https://github.com/llvm/llvm-project/pull/105964.diff
1 Files Affected:
- (modified) libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp (+2-2)
``````````diff
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
index 578efb90f7f1ab..9f1bb50e76dc97 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -228,8 +228,8 @@ int main(int, char**)
// But the rvalue to lvalue reference binding isn't allowed according to
// [over.match.ref] despite Clang accepting it.
test_is_constructible<int&, ExplicitTo<int&>>();
-#ifndef TEST_COMPILER_GCC
- test_is_constructible<const int&, ExplicitTo<int&&>>();
+#ifndef __clang__
+ test_is_not_constructible<const int&, ExplicitTo<int&&>>();
#endif
static_assert(std::is_constructible<int&&, ExplicitTo<int&&>>::value, "");
``````````
</details>
https://github.com/llvm/llvm-project/pull/105964
More information about the libcxx-commits
mailing list