Skip to content

Commit c225302

Browse files
committed
Use [[nodiscard]] attribute for all build systems
As we now require `C++17` support, the `[[nodiscard]]` attribute is required to be supported across all platforms.
1 parent ea77c96 commit c225302

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/util/nodiscard.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@ Author: Diffblue Ltd.
99
#ifndef CPROVER_UTIL_NODISCARD_H
1010
#define CPROVER_UTIL_NODISCARD_H
1111

12-
#if __has_cpp_attribute(nodiscard)
13-
# ifdef __clang__
14-
# pragma GCC diagnostic ignored "-Wc++1z-extensions"
15-
# endif
16-
// NOLINTNEXTLINE(whitespace/braces)
17-
# define NODISCARD [[nodiscard]]
18-
#elif __has_cpp_attribute(gnu::warn_unused_result)
19-
// NOLINTNEXTLINE(whitespace/braces)
20-
# define NODISCARD [[gnu::warn_unused_result]]
21-
#else
22-
# define NODISCARD
23-
#endif
12+
#define NODISCARD [[nodiscard]]
2413

2514
#endif // CPROVER_UTIL_NODISCARD_H

0 commit comments

Comments
 (0)