Make it possible to build a no-exceptions variant of libcxx.

Fixes a small omission in libcxx that prevents libcxx being built when
-DLIBCXX_ENABLE_EXCEPTIONS=0 is specified.

This patch adds XFAILS to all those tests that are currently failing
on the new -fno-exceptions library variant. Follow-up patches will
update the tests (progressively) to cope with the new library variant.

Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252598 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Asiri Rathnayake 2015-11-10 11:41:22 +00:00
parent 6b6407a6db
commit cc2e93cff0
158 changed files with 159 additions and 0 deletions

View File

@ -221,10 +221,12 @@ promise<void>::~promise()
{
if (__state_)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__state_->__has_value() && __state_->use_count() > 1)
__state_->set_exception(make_exception_ptr(
future_error(make_error_code(future_errc::broken_promise))
));
#endif // _LIBCPP_NO_EXCEPTIONS
__state_->__release_shared();
}
}

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// Test asan vector annotations with a class that throws in a CTOR.
#include <vector>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.cons

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// dynarray.cons
// explicit dynarray(size_type c);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// dynarray.overview
// const_reference at(size_type n) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <map>
// class map

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <array>
// reference operator[] (size_type)

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <deque>
// void push_back(const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <deque>
// void push_front(const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <forward_list>
// void push_front(const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <list>
// template <InputIterator Iter>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <list>
// iterator insert(const_iterator position, size_type n, const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <list>
// iterator insert(const_iterator position, const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <list>
// void push_back(const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <list>
// void push_front(const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <vector>
// void push_back(const value_type& x);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <unordered_map>
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,

View File

@ -9,6 +9,7 @@
//
// XFAIL: apple-darwin
// XFAIL: newlib
// XFAIL: libcpp-no-exceptions
// <uchar.h>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// optional<T>& operator=(const optional<T>& rhs);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// template <class... Args> void optional<T>::emplace(Args&&... args);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// template <class U, class... Args>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// optional<T>& operator=(optional<T>&& rhs)

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11
// XFAIL: libcpp-no-exceptions
// <optional>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// optional(const optional<T>& rhs);

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11
// XFAIL: libcpp-no-exceptions
// <optional>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// template <class U, class... Args>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// optional(optional<T>&& rhs) noexcept(is_nothrow_move_constructible<T>::value);

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11
// XFAIL: libcpp-no-exceptions
// <optional>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// T& optional<T>::value();

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// constexpr const T& optional<T>::value() const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// void swap(optional&)

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <optional>
// template <class T> void swap(optional<T>& x, optional<T>& y)

View File

@ -10,6 +10,7 @@
// NOTE: Older versions of clang have a bug where they fail to evalute
// string_view::at as a constant expression.
// XFAIL: clang-3.4, clang-3.3
// XFAIL: libcpp-no-exceptions
// <string_view>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1, const charT* s) const;

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const;

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1,

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1, basic_string_view str,

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string_view>
// size_type copy(charT* s, size_type n, size_type pos = 0) const;

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <ostream>
// template <class charT, class traits = char_traits<charT> >

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test operator new[]
// NOTE: asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test operator new [] (nothrow)
// NOTE: asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test operator new
// asan and msan will not call the new handler.

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test operator new (nothrow)
// asan and msan will not call the new handler.

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// exception_ptr current_exception();

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// template<class E> exception_ptr make_exception_ptr(E e);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <exception>
// void rethrow_exception [[noreturn]] (exception_ptr p);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test uncaught_exception
#include <exception>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test uncaught_exceptions
#include <exception>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <locale>
// template <class charT> class collate_byname

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <locale>
// wstring_convert<Codecvt, Elem, Wide_alloc, Byte_alloc>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <locale>
// template <class Facet> const Facet& use_facet(const locale& loc);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <locale>
// template <class Facet> locale combine(const locale& other) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <complex>
// template<class T>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <random>
// class random_device;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <random>
// class random_device;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// const_reference at(size_type pos) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// size_type capacity() const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// size_type max_size() const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// size_type max_size() const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// void reserve(size_type res_arg=0);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// void resize(size_type n);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// void resize(size_type n, charT c);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string(const basic_string<charT,traits,Allocator>& str,

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// size_type copy(charT* s, size_type n, size_type pos = 0) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos, size_type n1, const charT *s) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos, size_type n1, const charT *s, size_type n2) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos1, size_type n1, const basic_string& str) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos1, size_type n1, const basic_string& str,

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string substr(size_type pos = 0, size_type n = npos) const;

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// double stod(const string& str, size_t *idx = 0);

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// int stoi(const string& str, size_t *idx = 0, int base = 10);

Some files were not shown because too many files have changed in this diff Show More