Implement Pp0156r2: 'Variadic Lock Guard, version 5' Reviewed as https://reviews.llvm.org/D31163.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298681 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-03-24 03:40:36 +00:00
parent 50e32f569c
commit 59bcc879ab
16 changed files with 201 additions and 155 deletions

View File

@@ -1,37 +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: libcpp-has-no-threads
// TODO(EricWF) Investigate why typeid(...).name() returns a different string
// on GCC 4.9 but not newer GCCs.
// XFAIL: gcc-4.9
// XFAIL: windows
// THIS TESTS C++03 EXTENSIONS.
// <mutex>
// template <class ...Mutex> class lock_guard;
// Test that the the variadic lock guard implementation mangles the same in
// C++11 and C++03. This is important since the mangling of `lock_guard` depends
// on it being declared as a variadic template, even in C++03.
// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
#include <string>
#include <typeinfo>
#include <cassert>
int main() {
const std::string expect = "NSt3__110lock_guardIJNS_5mutexEEEE";
assert(typeid(std::lock_guard<std::mutex>).name() == expect);
}