available, rather than #ifdef'ing away the relevant tests if it's unavailable.
llvm-svn: 288543
//===----------------------------------------------------------------------===//
// Can a noexcept function pointer be caught by a non-noexcept catch clause?
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// UNSUPPORTED: libcxxabi-no-exceptions
+// UNSUPPORTED: libcxxabi-no-exceptions, libcxxabi-no-noexcept-function-type
#include <cassert>
-#ifdef __cpp_noexcept_function_type
template<bool Noexcept> void f() noexcept(Noexcept) {}
template<bool Noexcept> using FnType = void() noexcept(Noexcept);
check<true, true>();
check_deep();
}
-#else
-int main() {}
-#endif
// Can a noexcept member function pointer be caught by a non-noexcept catch
// clause?
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// UNSUPPORTED: libcxxabi-no-exceptions
+// UNSUPPORTED: libcxxabi-no-exceptions, libcxxabi-no-noexcept-function-type
#include <cassert>
-#ifdef __cpp_noexcept_function_type
struct X {
template<bool Noexcept> void f() noexcept(Noexcept) {}
};
check<true, true>();
check_deep();
}
-#else
-int main() {}
-#endif
self.libcxxabi_obj_root = self.get_lit_conf('libcxxabi_obj_root')
super(Configuration, self).configure_obj_root()
+ def has_cpp_feature(self, feature, required_value):
+ return int(self.cxx.dumpMacros().get('__cpp_' + feature, 0)) >= required_value
+
def configure_features(self):
super(Configuration, self).configure_features()
if not self.get_lit_bool('enable_exceptions', True):
self.config.available_features.add('libcxxabi-no-exceptions')
+ if not self.has_cpp_feature('noexcept_function_type', 201510):
+ self.config.available_features.add('libcxxabi-no-noexcept-function-type')
def configure_compile_flags(self):
self.cxx.compile_flags += ['-DLIBCXXABI_NO_TIMER']