summaryrefslogtreecommitdiff
path: root/TestPrograms/test_cxx11_noexcept.cxx
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-08-06 00:39:40 -0400
committerJeffrey Walton <noloader@gmail.com>2020-08-06 00:39:40 -0400
commit029d92d412a7291ac35789a1f4bc26c48a41f32e (patch)
tree2611d4b0ee4a6b8d99ff172d70191b4a8115da6d /TestPrograms/test_cxx11_noexcept.cxx
parent66d7a2a6045d092a3d131cf06289e68b9ba46e3b (diff)
downloadcryptopp-git-029d92d412a7291ac35789a1f4bc26c48a41f32e.tar.gz
Add C++11, C++14 and C++17 support to configure.sh
Diffstat (limited to 'TestPrograms/test_cxx11_noexcept.cxx')
-rw-r--r--TestPrograms/test_cxx11_noexcept.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/TestPrograms/test_cxx11_noexcept.cxx b/TestPrograms/test_cxx11_noexcept.cxx
new file mode 100644
index 00000000..95cca1bc
--- /dev/null
+++ b/TestPrograms/test_cxx11_noexcept.cxx
@@ -0,0 +1,18 @@
+#define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10)
+#if (GNUC_VERSION >= 4060) || defined(__clang__)
+# pragma GCC diagnostic ignored "-Wterminate"
+#endif
+
+#include <stdexcept>
+
+void f(int n) noexcept(false)
+{
+ if (n > 2)
+ throw std::runtime_error("Oops");
+}
+
+int main(int argc, char* argv[])
+{
+ f(argc);
+ return 0;
+}