diff options
author | Jeffrey Walton <noloader@gmail.com> | 2020-08-06 00:39:40 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2020-08-06 00:39:40 -0400 |
commit | 029d92d412a7291ac35789a1f4bc26c48a41f32e (patch) | |
tree | 2611d4b0ee4a6b8d99ff172d70191b4a8115da6d /TestPrograms/test_cxx11_noexcept.cxx | |
parent | 66d7a2a6045d092a3d131cf06289e68b9ba46e3b (diff) | |
download | cryptopp-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.cxx | 18 |
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;
+}
|