'-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER',
'-Wall', '-Wextra', '-Werror'
]
- # FIXME turn this back on after fixing potential breakage.
- #self.cxx.addWarningFlagIfSupported('-Wshadow')
+ self.cxx.addWarningFlagIfSupported('-Wshadow')
self.cxx.addWarningFlagIfSupported('-Wno-unused-command-line-argument')
self.cxx.addWarningFlagIfSupported('-Wno-attributes')
self.cxx.addWarningFlagIfSupported('-Wno-pessimizing-move')
self.cxx.addWarningFlagIfSupported('-Wno-user-defined-literals')
# TODO(EricWF) Remove the unused warnings once the test suite
# compiles clean with them.
+ self.cxx.addWarningFlagIfSupported('-Wno-sign-compare')
self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
self.cxx.addWarningFlagIfSupported('-Wno-unused-variable')
self.cxx.addWarningFlagIfSupported('-Wno-unused-parameter')
- self.cxx.addWarningFlagIfSupported('-Wno-sign-compare')
std = self.get_lit_conf('std', None)
if std in ['c++98', 'c++03']:
# The '#define static_assert' provided by libc++ in C++03 mode
env.create_file(testFile, 42);
// Test that we can iterator over the directory before changing the perms
- directory_iterator it(testDir);
- TEST_REQUIRE(it != directory_iterator{});
-
+ {
+ directory_iterator it(testDir);
+ TEST_REQUIRE(it != directory_iterator{});
+ }
// Change the permissions so we can no longer iterate
permissions(testDir, perms::none);
int main() {
using namespace fs;
- const path p("/foo/bar/baz");
{
path p;
ASSERT_NOEXCEPT(p.clear());
assert(p.empty());
}
{
+ const path p("/foo/bar/baz");
path p2(p);
assert(p == p2);
p2.clear();
using namespace fs;
const char* const value = "hello world";
const std::string str_value = value;
- path p(value);
{ // Check signature
+ path p(value);
ASSERT_SAME_TYPE(path::value_type const*, decltype(p.c_str()));
ASSERT_NOEXCEPT(p.c_str());
}
{
using namespace fs;
const char* const value = "hello world";
- path p(value);
{ // Check signature
+ path p(value);
ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native()));
ASSERT_NOEXCEPT(p.native());
}
using namespace fs;
using string_type = path::string_type;
const char* const value = "hello world";
- path p(value);
{ // Check signature
+ path p(value);
static_assert(std::is_convertible<path, string_type>::value, "");
static_assert(std::is_constructible<string_type, path>::value, "");
ASSERT_SAME_TYPE(string_type, decltype(p.operator string_type()));
env.create_file(testFile, 42);
// Test that we can iterator over the directory before changing the perms
- RDI it(testDir);
- TEST_REQUIRE(it != RDI{});
+ {
+ RDI it(testDir);
+ TEST_REQUIRE(it != RDI{});
+ }
// Change the permissions so we can no longer iterate
permissions(testDir, perms::none);
#ifndef TEST_HAS_NO_EXCEPTIONS
{
TestResource R2;
- auto& P = R2.getController();
- P.throw_on_alloc = true;
+ auto& P2 = R2.getController();
+ P2.throw_on_alloc = true;
memory_resource& M2 = R2;
try {
M2.allocate(42);
#include <iterator>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
#include "test_macros.h"
#include "test_iterators.h"
assert(rr == x);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
struct do_nothing
{
void operator()(void*) const {}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
- char s[] = "1234567890";
- test(random_access_iterator<char*>(s+5), 4, '0');
- test(s+5, 4, '0');
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- int i[5];
- typedef std::unique_ptr<int, do_nothing> Ptr;
- Ptr p[5];
- for (unsigned j = 0; j < 5; ++j)
- p[j].reset(i+j);
- test(p, 3, Ptr(i+3));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+ {
+ char s[] = "1234567890";
+ test(random_access_iterator<char*>(s+5), 4, '0');
+ test(s+5, 4, '0');
+ }
+#if TEST_STD_VER >= 11
+ {
+ int i[5];
+ typedef std::unique_ptr<int, do_nothing> Ptr;
+ Ptr p[5];
+ for (unsigned j = 0; j < 5; ++j)
+ p[j].reset(i+j);
+ test(p, 3, Ptr(i+3));
+ }
+#endif
#if TEST_STD_VER > 14
{
constexpr const char *p = "123456789";
#include <iterator>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
#include "test_macros.h"
assert(x2 == x);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
struct do_nothing
{
void operator()(void*) const {}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
- A a;
- test(&a, A());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- int i;
- std::unique_ptr<int, do_nothing> p(&i);
- test(&p, std::unique_ptr<int, do_nothing>(&i));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+ {
+ A a;
+ test(&a, A());
+ }
+#if TEST_STD_VER >= 11
+ {
+ int i;
+ std::unique_ptr<int, do_nothing> p(&i);
+ test(&p, std::unique_ptr<int, do_nothing>(&i));
+ }
+#endif
#if TEST_STD_VER > 14
{
constexpr const char *p = "123456789";