Skip to content

Commit 182de29

Browse files
committed
Add argument to static_assert() call to work with compilers that default to c++14 or earlier.
1 parent fbbb8ad commit 182de29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/test/Sema/ms_predefined_expr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ constexpr bool equal(const T (&a)[N], const T (&b)[N]) {
5151
return true;
5252
}
5353

54-
#define ASSERT_EQ(X, Y) static_assert(equal(X, Y))
55-
#define ASSERT_EQ_TY(X, Y) static_assert(is_same<decltype((X)[0]), decltype((Y)[0])>)
54+
#define ASSERT_EQ(X, Y) static_assert(equal(X, Y), "")
55+
#define ASSERT_EQ_TY(X, Y) static_assert(is_same<decltype((X)[0]), decltype((Y)[0])>, "")
5656

5757
#define _WIDE(s) L##s
5858
#define WIDE(s) _WIDE(s)
@@ -158,7 +158,7 @@ constexpr size_t operator""_len(const char*, size_t len) {
158158
}
159159

160160
void test_udliteral() {
161-
static_assert(__FUNCTION__ ""_len == 14); // expected-warning{{expansion of predefined identifier '__FUNCTION__' to a string literal is a Microsoft extension}}
161+
static_assert(__FUNCTION__ ""_len == 14, ""); // expected-warning{{expansion of predefined identifier '__FUNCTION__' to a string literal is a Microsoft extension}}
162162
}
163163

164164
void test_static_assert() {

0 commit comments

Comments
 (0)