// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-skip-if "" { *-*-* } { "-fno-exceptions" } }
+// { dg-require-effective-target exceptions_enabled }
#include <vector>
#include <ext/throw_allocator.h>
void
examine_symbol(const char* name, const char* file)
{
- try
- {
- symbols s = create_symbols(file);
- const symbol& sym = get_symbol(name, s);
- sym.print();
- }
- catch(...)
- { __throw_exception_again; }
+ symbols s = create_symbols(file);
+ const symbol& sym = get_symbol(name, s);
+ sym.print();
}
int
return true;
}
+#if __cpp_exceptions
template<typename Alloc>
bool
check_allocate_max_size()
}
throw;
}
+#endif
// A simple allocator which can be constructed endowed of a given
// "personality" (an integer), queried in operator== to simulate the
#endif // C++11
#if __cplusplus >= 201703L
-#if __cpp_aligned_new && __cpp_rtti
+#if __cpp_aligned_new && __cpp_rtti && __cpp_exceptions
// A concrete memory_resource, with error checking.
class memory_resource : public std::pmr::memory_resource
{
void
erase_external_iterators(std::multimap<int, int>& s);
-// NB: "must be compiled with C++11"
-#if __cplusplus >= 201103L
+#if __cplusplus < 201103L
+# error "must be compiled with C++11 (or later)"
+#else
template<typename _Tp>
void
linkage_check_cxx98_cxx11_erase(_Tp& container)
extern "C" void
try_throw_exception()
{
+#if __cpp_exceptions
try
{
std::__throw_bad_exception();
}
catch (const std::exception& e)
{ }
+#endif
}
extern "C" void
std::__throw_bad_exception();
}
-#if __cplusplus < 201103L
-// "must be compiled with C++98"
+#if __cplusplus >= 201103L
+# error "must be compiled with C++98"
+#else
void
erase_external(std::set<int>& s)
{ s.erase(s.begin()); }