mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00

test/std/strings/string.classes/typedefs.pass.cpp Actually test what basic_string's typedefs stand for. test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp NotDerived and ND were completely unused. test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp P2 was mistakenly not being used. Yes, that's right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING! Fixes D29137. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294156 91177308-0d34-0410-b5e6-96231b3b80d8
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <utility>
|
|
|
|
// template <class T1, class T2> struct pair
|
|
|
|
// constexpr pair();
|
|
|
|
// This test doesn't pass due to a constexpr bug in GCC 4.9 that fails
|
|
// to initialize any type without a user provided constructor in a constant
|
|
// expression (e.g. float).
|
|
// XFAIL: gcc-4.9
|
|
|
|
// NOTE: The SFINAE on the default constructor is tested in
|
|
// default-sfinae.pass.cpp
|
|
|
|
|
|
#include <utility>
|
|
#include <type_traits>
|
|
#include <cassert>
|
|
|
|
#include "test_macros.h"
|
|
#include "archetypes.hpp"
|
|
|
|
int main()
|
|
{
|
|
{
|
|
typedef std::pair<float, short*> P;
|
|
P p;
|
|
assert(p.first == 0.0f);
|
|
assert(p.second == nullptr);
|
|
}
|
|
#if TEST_STD_VER >= 11
|
|
{
|
|
typedef std::pair<float, short*> P;
|
|
constexpr P p;
|
|
static_assert(p.first == 0.0f, "");
|
|
static_assert(p.second == nullptr, "");
|
|
}
|
|
{
|
|
using NoDefault = ImplicitTypes::NoDefault;
|
|
using P = std::pair<int, NoDefault>;
|
|
static_assert(!std::is_default_constructible<P>::value, "");
|
|
using P2 = std::pair<NoDefault, int>;
|
|
static_assert(!std::is_default_constructible<P2>::value, "");
|
|
}
|
|
#endif
|
|
}
|