Skip to content

Commit 5f2d335

Browse files
committed
Fix
1 parent 2e535e4 commit 5f2d335

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/test/libcxx/language.support/nodiscard.verify.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ void test() {
117117
std::current_exception();
118118
}
119119

120+
#if TEST_STD_VER >= 11
120121
{ // <initializer_list>
121122
std::initializer_list<int> il{94, 82, 49};
122123

123124
il.size(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
124125
il.begin(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
125126
il.end(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
126127
}
128+
#endif
127129
}

0 commit comments

Comments
 (0)