Compare commits

..

2 Commits

Author SHA1 Message Date
Howard Hinnant
b35e5e29aa made better error message for <atomic>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/tags/libcpp-16@128699 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 00:54:26 +00:00
Howard Hinnant
d6c08cd1ae Tagging 16
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/tags/libcpp-16@127472 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 18:16:05 +00:00
10 changed files with 62 additions and 139 deletions

View File

@@ -5,10 +5,10 @@
#===============================================================================
project(libcxx CXX C)
cmake_minimum_required(VERSION 2.6.4)
cmake_minimum_required(VERSION 2.8)
set(PACKAGE_NAME libcxx)
set(PACKAGE_VERSION lll)
set(PACKAGE_VERSION trunk-svn)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")

View File

@@ -184,12 +184,10 @@ namespace std {
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
#else // __GXX_EXPERIMENTAL_CXX0X__
#define _LIBCPP_HAS_NO_TRAILING_RETURN
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -209,6 +207,7 @@ namespace std {
#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
#define _LIBCPP_HAS_NO_NULLPTR
#endif

View File

@@ -769,7 +769,6 @@ public:
typedef typename __alloc_traits::difference_type difference_type;
typedef __tree_node<value_type, typename __alloc_traits::void_pointer> __node;
typedef __tree_node_base<typename __alloc_traits::void_pointer> __node_base;
typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
rebind_alloc<__node>
@@ -780,10 +779,10 @@ public:
typedef allocator_traits<__node_allocator> __node_traits;
typedef typename __node_traits::pointer __node_pointer;
typedef typename __node_traits::const_pointer __node_const_pointer;
typedef typename __node_base::pointer __node_base_pointer;
typedef typename __node_base::const_pointer __node_base_const_pointer;
typedef typename __node::base::pointer __node_base_pointer;
typedef typename __node::base::const_pointer __node_base_const_pointer;
private:
typedef typename __node_base::base __end_node_t;
typedef typename __node::base::base __end_node_t;
typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
rebind<__end_node_t>
@@ -997,19 +996,19 @@ public:
__node_holder remove(const_iterator __p);
private:
typename __node_base::pointer&
__find_leaf_low(typename __node_base::pointer& __parent, const value_type& __v);
typename __node_base::pointer&
__find_leaf_high(typename __node_base::pointer& __parent, const value_type& __v);
typename __node_base::pointer&
typename __node::base::pointer&
__find_leaf_low(typename __node::base::pointer& __parent, const value_type& __v);
typename __node::base::pointer&
__find_leaf_high(typename __node::base::pointer& __parent, const value_type& __v);
typename __node::base::pointer&
__find_leaf(const_iterator __hint,
typename __node_base::pointer& __parent, const value_type& __v);
typename __node::base::pointer& __parent, const value_type& __v);
template <class _Key>
typename __node_base::pointer&
__find_equal(typename __node_base::pointer& __parent, const _Key& __v);
typename __node::base::pointer&
__find_equal(typename __node::base::pointer& __parent, const _Key& __v);
template <class _Key>
typename __node_base::pointer&
__find_equal(const_iterator __hint, typename __node_base::pointer& __parent,
typename __node::base::pointer&
__find_equal(const_iterator __hint, typename __node::base::pointer& __parent,
const _Key& __v);
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
@@ -1411,8 +1410,8 @@ __tree<_Tp, _Compare, _Allocator>::clear()
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer& __parent,
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node::base::pointer& __parent,
const value_type& __v)
{
__node_pointer __nd = __root();
@@ -1450,8 +1449,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointer& __parent,
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node::base::pointer& __parent,
const value_type& __v)
{
__node_pointer __nd = __root();
@@ -1492,9 +1491,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
typename __node_base::pointer& __parent,
typename __node::base::pointer& __parent,
const value_type& __v)
{
if (__hint == end() || !value_comp()(*__hint, __v)) // check before
@@ -1528,8 +1527,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
// If __v exists, set parent to node of __v and return reference to node of __v
template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& __parent,
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node::base::pointer& __parent,
const _Key& __v)
{
__node_pointer __nd = __root();
@@ -1577,9 +1576,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& _
// If __v exists, set parent to node of __v and return reference to node of __v
template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
typename __node_base::pointer& __parent,
typename __node::base::pointer& __parent,
const _Key& __v)
{
if (__hint == end() || value_comp()(__v, *__hint)) // check before

View File

@@ -1276,7 +1276,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Y> const& __p)
template <class _CharT, class _Traits, size_t _Size>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
operator<<(basic_ostream<_CharT, _Traits>& __os, bitset<_Size>& __x)
{
return __os << __x.template to_string<_CharT, _Traits>
(use_facet<ctype<_CharT> >(__os.getloc()).widen('0'),

View File

@@ -1264,7 +1264,6 @@ struct __state
vector<pair<size_t, const _CharT*> > __loop_data_;
const __node<_CharT>* __node_;
regex_constants::match_flag_type __flags_;
bool __at_first_;
_LIBCPP_INLINE_VISIBILITY
__state()
@@ -1891,40 +1890,6 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const
}
}
// __l_anchor
template <class _CharT>
class __l_anchor
: public __owns_one_state<_CharT>
{
typedef __owns_one_state<_CharT> base;
public:
typedef _STD::__state<_CharT> __state;
_LIBCPP_INLINE_VISIBILITY
__l_anchor(__node<_CharT>* __s)
: base(__s) {}
virtual void __exec(__state&) const;
};
template <class _CharT>
void
__l_anchor<_CharT>::__exec(__state& __s) const
{
if (__s.__at_first_ && __s.__current_ == __s.__first_)
{
__s.__do_ = __state::__accept_but_not_consume;
__s.__node_ = this->first();
}
else
{
__s.__do_ = __state::__reject;
__s.__node_ = nullptr;
}
}
// __r_anchor
template <class _CharT>
@@ -2429,6 +2394,7 @@ private:
int __open_count_;
shared_ptr<__empty_state<_CharT> > __start_;
__owns_one_state<_CharT>* __end_;
bool __left_anchor_;
typedef _STD::__state<_CharT> __state;
typedef _STD::__node<_CharT> __node;
@@ -2450,17 +2416,17 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_regex()
: __flags_(), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
__end_(0), __left_anchor_(false)
{}
_LIBCPP_INLINE_VISIBILITY
explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
__end_(0), __left_anchor_(false)
{__parse(__p, __p + __traits_.length(__p));}
_LIBCPP_INLINE_VISIBILITY
basic_regex(const value_type* __p, size_t __len, flag_type __f)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
__end_(0), __left_anchor_(false)
{__parse(__p, __p + __len);}
// basic_regex(const basic_regex&) = default;
// basic_regex(basic_regex&&) = default;
@@ -2469,20 +2435,20 @@ public:
explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
__end_(0), __left_anchor_(false)
{__parse(__p.begin(), __p.end());}
template <class _ForwardIterator>
_LIBCPP_INLINE_VISIBILITY
basic_regex(_ForwardIterator __first, _ForwardIterator __last,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
__end_(0), __left_anchor_(false)
{__parse(__first, __last);}
_LIBCPP_INLINE_VISIBILITY
basic_regex(initializer_list<value_type> __il,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
__end_(0), __left_anchor_(false)
{__parse(__il.begin(), __il.end());}
// ~basic_regex() = default;
@@ -2540,6 +2506,7 @@ private:
__loop_count_ = 0;
__open_count_ = 0;
__end_ = nullptr;
__left_anchor_ = false;
}
public:
@@ -2727,7 +2694,7 @@ private:
basic_string<_CharT>* __str = nullptr);
_LIBCPP_INLINE_VISIBILITY
void __push_l_anchor();
void __push_l_anchor() {__left_anchor_ = true;}
void __push_r_anchor();
void __push_match_any();
void __push_match_any_but_newline();
@@ -2765,22 +2732,22 @@ private:
bool
__match_at_start(const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool) const;
regex_constants::match_flag_type __flags) const;
template <class _Allocator>
bool
__match_at_start_ecma(const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool) const;
regex_constants::match_flag_type __flags) const;
template <class _Allocator>
bool
__match_at_start_posix_nosubs(const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool) const;
regex_constants::match_flag_type __flags) const;
template <class _Allocator>
bool
__match_at_start_posix_subs(const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool) const;
regex_constants::match_flag_type __flags) const;
template <class _B, class _A, class _C, class _T>
friend
@@ -2842,6 +2809,7 @@ basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
swap(__open_count_, __r.__open_count_);
swap(__start_, __r.__start_);
swap(__end_, __r.__end_);
swap(__left_anchor_, __r.__left_anchor_);
}
template <class _CharT, class _Traits>
@@ -2882,9 +2850,7 @@ __lookahead<_CharT, _Traits>::__exec(__state& __s) const
match_results<const _CharT*> __m;
__m.__init(1 + __exp_.mark_count(), __s.__current_, __s.__last_);
bool __matched = __exp_.__match_at_start_ecma(__s.__current_, __s.__last_,
__m,
__s.__flags_ | regex_constants::match_continuous,
true);
__m, __s.__flags_);
if (__matched != __invert_)
{
__s.__do_ = __state::__accept_but_not_consume;
@@ -4121,6 +4087,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
basic_regex __exp;
__exp.__flags_ = __flags_;
__temp = __exp.__parse(++__temp, __last);
__exp.__push_l_anchor();
__push_lookahead(_STD::move(__exp), false);
#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last || *__temp != ')')
@@ -4134,6 +4101,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
basic_regex __exp;
__exp.__flags_ = __flags_;
__temp = __exp.__parse(++__temp, __last);
__exp.__push_l_anchor();
__push_lookahead(_STD::move(__exp), true);
#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last || *__temp != ')')
@@ -4608,14 +4576,6 @@ basic_regex<_CharT, _Traits>::__push_end_marked_subexpression(unsigned __sub)
}
}
template <class _CharT, class _Traits>
void
basic_regex<_CharT, _Traits>::__push_l_anchor()
{
__end_->first() = new __l_anchor<_CharT>(__end_->first());
__end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
}
template <class _CharT, class _Traits>
void
basic_regex<_CharT, _Traits>::__push_r_anchor()
@@ -5481,7 +5441,7 @@ bool
basic_regex<_CharT, _Traits>::__match_at_start_ecma(
const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool __at_first) const
regex_constants::match_flag_type __flags) const
{
vector<__state> __states;
ptrdiff_t __j = 0;
@@ -5498,7 +5458,6 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
__states.back().__loop_data_.resize(__loop_count());
__states.back().__node_ = __st;
__states.back().__flags_ = __flags;
__states.back().__at_first_ = __at_first;
bool __matched = false;
do
{
@@ -5547,7 +5506,7 @@ bool
basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool __at_first) const
regex_constants::match_flag_type __flags) const
{
deque<__state> __states;
ptrdiff_t __highest_j = 0;
@@ -5563,7 +5522,6 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
__states.back().__loop_data_.resize(__loop_count());
__states.back().__node_ = __st;
__states.back().__flags_ = __flags;
__states.back().__at_first_ = __at_first;
bool __matched = false;
do
{
@@ -5625,7 +5583,7 @@ bool
basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool __at_first) const
regex_constants::match_flag_type __flags) const
{
vector<__state> __states;
__state __best_state;
@@ -5644,7 +5602,6 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
__states.back().__loop_data_.resize(__loop_count());
__states.back().__node_ = __st;
__states.back().__flags_ = __flags;
__states.back().__at_first_ = __at_first;
const _CharT* __current = __first;
bool __matched = false;
do
@@ -5710,13 +5667,13 @@ bool
basic_regex<_CharT, _Traits>::__match_at_start(
const _CharT* __first, const _CharT* __last,
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool __at_first) const
regex_constants::match_flag_type __flags) const
{
if ((__flags_ & 0x1F0) == ECMAScript)
return __match_at_start_ecma(__first, __last, __m, __flags, __at_first);
return __match_at_start_ecma(__first, __last, __m, __flags);
if (mark_count() == 0)
return __match_at_start_posix_nosubs(__first, __last, __m, __flags, __at_first);
return __match_at_start_posix_subs(__first, __last, __m, __flags, __at_first);
return __match_at_start_posix_nosubs(__first, __last, __m, __flags);
return __match_at_start_posix_subs(__first, __last, __m, __flags);
}
template <class _CharT, class _Traits>
@@ -5727,9 +5684,11 @@ basic_regex<_CharT, _Traits>::__search(
match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags) const
{
if (__left_anchor_)
__flags |= regex_constants::match_continuous;
__m.__init(1 + mark_count(), __first, __last,
__flags & regex_constants::__no_update_pos);
if (__match_at_start(__first, __last, __m, __flags, true))
if (__match_at_start(__first, __last, __m, __flags))
{
__m.__prefix_.second = __m[0].first;
__m.__prefix_.matched = __m.__prefix_.first != __m.__prefix_.second;
@@ -5743,7 +5702,7 @@ basic_regex<_CharT, _Traits>::__search(
for (++__first; __first != __last; ++__first)
{
__m.__matches_.assign(__m.size(), __m.__unmatched_);
if (__match_at_start(__first, __last, __m, __flags, false))
if (__match_at_start(__first, __last, __m, __flags))
{
__m.__prefix_.second = __m[0].first;
__m.__prefix_.matched = __m.__prefix_.first != __m.__prefix_.second;

View File

@@ -14,10 +14,12 @@ endif()
if (LIBCXX_ENABLE_SHARED)
add_library(cxx SHARED
${sources}
${headers}
)
else()
add_library(cxx STATIC
${sources}
${headers}
)
endif()
@@ -48,10 +50,8 @@ install(TARGETS cxx
)
install(DIRECTORY ../include/
DESTINATION include/libcxx/v1
DESTINATION include/c++/v1
FILES_MATCHING
PATTERN "*"
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
)

View File

@@ -32,7 +32,7 @@ if(PYTHONINTERP_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
@ONLY)
add_custom_target(libcxx.check
add_custom_target(check
COMMAND ${PYTHON_EXECUTABLE}
${LIT_EXECUTABLE}
${LIT_ARGS}
@@ -40,5 +40,5 @@ if(PYTHONINTERP_FOUND)
DEPENDS
COMMENT "Running libcxx tests")
else()
message(WARNING "Could not find Python, no libcxx.check target will be available!")
message(WARNING "Could not find Python, no check target will be available!")
endif()

View File

@@ -1,25 +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.
//
//===----------------------------------------------------------------------===//
// <map>
// class map
// map();
#include <map>
struct X
{
std::multimap<int, X> m;
};
int main()
{
}

View File

@@ -20,22 +20,13 @@ struct A
}
};
struct B
{
B()
{
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
assert(!std::uncaught_exception());
}
};
int main()
{
try
{
A a;
assert(!std::uncaught_exception());
throw B();
throw 1;
}
catch (...)
{

View File

@@ -255,7 +255,7 @@ changed. Please see:
<tr>
<td><tt>is_base_of&lt;T, U&gt;</tt></td>
<td bgcolor="#80FF80"><tt>__is_base_of(T, U)</tt></td>
<td bgcolor="#FF5965"><tt>__is_base_of(T, U)</tt></td>
</tr>
<tr>