|
@@ -10,13 +10,15 @@
|
|
|
// UNSUPPORTED: c++98, c++03
|
|
|
// UNSUPPORTED: libcpp-no-exceptions
|
|
|
|
|
|
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
|
|
|
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
|
|
|
+
|
|
|
// <experimental/filesystem>
|
|
|
|
|
|
// class path
|
|
|
|
|
|
#define _LIBCPP_DEBUG 0
|
|
|
-#define _LIBCPP_ASSERT(cond, msg) ((cond) ? ((void)0) : throw 42)
|
|
|
-
|
|
|
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
|
|
|
#include <experimental/filesystem>
|
|
|
#include <iterator>
|
|
|
#include <type_traits>
|
|
@@ -29,17 +31,18 @@ namespace fs = std::experimental::filesystem;
|
|
|
|
|
|
int main() {
|
|
|
using namespace fs;
|
|
|
+ using ExType = std::__libcpp_debug_exception;
|
|
|
// Test incrementing/decrementing a singular iterator
|
|
|
{
|
|
|
path::iterator singular;
|
|
|
try {
|
|
|
++singular;
|
|
|
assert(false);
|
|
|
- } catch (int) {}
|
|
|
+ } catch (ExType const&) {}
|
|
|
try {
|
|
|
--singular;
|
|
|
assert(false);
|
|
|
- } catch (int) {}
|
|
|
+ } catch (ExType const&) {}
|
|
|
}
|
|
|
// Test decrementing the begin iterator
|
|
|
{
|
|
@@ -48,13 +51,13 @@ int main() {
|
|
|
try {
|
|
|
--it;
|
|
|
assert(false);
|
|
|
- } catch (int) {}
|
|
|
+ } catch (ExType const&) {}
|
|
|
++it;
|
|
|
++it;
|
|
|
try {
|
|
|
++it;
|
|
|
assert(false);
|
|
|
- } catch (int) {}
|
|
|
+ } catch (ExType const&) {}
|
|
|
}
|
|
|
// Test incrementing the end iterator
|
|
|
{
|
|
@@ -63,12 +66,12 @@ int main() {
|
|
|
try {
|
|
|
++it;
|
|
|
assert(false);
|
|
|
- } catch (int) {}
|
|
|
+ } catch (ExType const&) {}
|
|
|
--it;
|
|
|
--it;
|
|
|
try {
|
|
|
--it;
|
|
|
assert(false);
|
|
|
- } catch (int) {}
|
|
|
+ } catch (ExType const&) {}
|
|
|
}
|
|
|
}
|