We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fec047 commit 7d0fa2cCopy full SHA for 7d0fa2c
src/util/nodiscard.h
@@ -0,0 +1,23 @@
1
+/*******************************************************************\
2
+
3
+Module: Util
4
5
+Author: Diffblue Ltd.
6
7
+\*******************************************************************/
8
9
+#ifndef CPROVER_UTIL_NODISCARD_H
10
+#define CPROVER_UTIL_NODISCARD_H
11
12
+#if __has_cpp_attribute(nodiscard)
13
+# ifdef __clang__
14
+# pragma GCC diagnostic ignored "-Wc++17-extensions"
15
+# endif
16
+# define NODISCARD [[nodiscard]]
17
+#elif __has_cpp_attribute(gnu::warn_unused_result)
18
+# define NODISCARD [[gnu::warn_unused_result]]
19
+#else
20
+# define NODISCARD
21
+#endif
22
23
+#endif // CPROVER_UTIL_NODISCARD_H
0 commit comments