Skip to content

Commit a0431dc

Browse files
committed
Avoid unused variable warnings when asserts are off
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
1 parent 87f4210 commit a0431dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/include/chpl/util/assertions.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ void chpl_unimpl(const char* filename, const char* func, int lineno,
4242
#ifdef NDEBUG
4343
// release mode
4444
#define CHPL_ASSERT(expr__) \
45-
do {} while (0)
45+
do { \
46+
if constexpr (false) { \
47+
std::ignore = expr__; \
48+
} \
49+
} while (0)
4650

4751
#else
4852
// debug mode

0 commit comments

Comments
 (0)