mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
Revert r372777: [libc++] Implement LWG 2510 and its follow-ups
This also reverts: - r372778: [libc++] Implement LWG 3158 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older - r372787: Purge mentions of GCC 4 from the test suite Reason: the change breaks compilation of LLVM with libc++, for details see http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372832 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
// UNSUPPORTED: libcpp-has-no-threads
|
||||
|
||||
// Before GCC 6, aggregate initialization kicks in.
|
||||
// See https://stackoverflow.com/q/41799015/627587.
|
||||
// UNSUPPORTED: gcc-5
|
||||
|
||||
// <mutex>
|
||||
|
||||
// struct defer_lock_t { explicit defer_lock_t() = default; };
|
||||
// struct try_to_lock_t { explicit try_to_lock_t() = default; };
|
||||
// struct adopt_lock_t { explicit adopt_lock_t() = default; };
|
||||
|
||||
// This test checks for LWG 2510.
|
||||
|
||||
#include <mutex>
|
||||
|
||||
|
||||
std::defer_lock_t f1() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
|
||||
std::try_to_lock_t f2() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
|
||||
std::adopt_lock_t f3() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
|
||||
|
||||
int main(int, char**) {
|
||||
return 0;
|
||||
}
|
@@ -10,15 +10,16 @@
|
||||
|
||||
// <mutex>
|
||||
|
||||
// struct defer_lock_t { explicit defer_lock_t() = default; };
|
||||
// struct try_to_lock_t { explicit try_to_lock_t() = default; };
|
||||
// struct adopt_lock_t { explicit adopt_lock_t() = default; };
|
||||
// struct defer_lock_t {};
|
||||
// struct try_to_lock_t {};
|
||||
// struct adopt_lock_t {};
|
||||
//
|
||||
// constexpr defer_lock_t defer_lock{};
|
||||
// constexpr try_to_lock_t try_to_lock{};
|
||||
// constexpr adopt_lock_t adopt_lock{};
|
||||
|
||||
#include <mutex>
|
||||
#include <type_traits>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
@@ -32,5 +33,5 @@ int main(int, char**)
|
||||
T2 t2 = std::try_to_lock; ((void)t2);
|
||||
T3 t3 = std::adopt_lock; ((void)t3);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user