diff --git a/libcxx/test/libcxx/diagnostics/enable_nodiscard_ext.verify.cpp b/libcxx/test/libcxx/diagnostics/enable_nodiscard_ext.verify.cpp --- a/libcxx/test/libcxx/diagnostics/enable_nodiscard_ext.verify.cpp +++ b/libcxx/test/libcxx/diagnostics/enable_nodiscard_ext.verify.cpp @@ -20,8 +20,8 @@ _LIBCPP_NODISCARD_AFTER_CXX17 int bar() { return 42; } int main(int, char**) { - foo(); // expected-warning-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} - bar(); // expected-warning-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + foo(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + bar(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} (void)foo(); // OK. void casts disable the diagnostic. (void)bar(); diff --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp --- a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp +++ b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp @@ -35,289 +35,289 @@ void test_algorithms() { int arr[1] = { 1 }; - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::adjacent_find(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::adjacent_find(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::all_of(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::any_of(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::binary_search(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::binary_search(std::begin(arr), std::end(arr), 1, std::greater()); #if TEST_STD_VER >= 17 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::clamp(2, 1, 3); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::clamp(2, 1, 3, std::greater()); #endif - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::count_if(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::count(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::equal_range(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::equal_range(std::begin(arr), std::end(arr), 1, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::equal(std::begin(arr), std::end(arr), std::begin(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::equal(std::begin(arr), std::end(arr), std::begin(arr), std::greater()); #if TEST_STD_VER >= 14 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::equal(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::equal(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); #endif - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find_end(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find_end(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find_first_of(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find_first_of(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find_if_not(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find_if(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::find(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::get_temporary_buffer(1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::includes(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::includes(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_heap_until(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_heap_until(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_heap(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_heap(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_partitioned(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr), std::greater()); #if TEST_STD_VER >= 14 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); #endif - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_sorted_until(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_sorted_until(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_sorted(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::is_sorted(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::lexicographical_compare(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::lexicographical_compare(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::lower_bound(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::lower_bound(std::begin(arr), std::end(arr), 1, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::max_element(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::max_element(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::max(1, 2); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::max(1, 2, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::max({1, 2, 3}); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::max({1, 2, 3}, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::min_element(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::min_element(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::min(1, 2); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::min(1, 2, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::min({1, 2, 3}); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::min({1, 2, 3}, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::minmax_element(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::minmax_element(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::minmax(1, 2); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::minmax(1, 2, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::minmax({1, 2, 3}); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::minmax({1, 2, 3}, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::mismatch(std::begin(arr), std::end(arr), std::begin(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::mismatch(std::begin(arr), std::end(arr), std::begin(arr), std::greater()); #if TEST_STD_VER >= 14 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::mismatch(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::mismatch(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); #endif - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::none_of(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::remove_if(std::begin(arr), std::end(arr), P()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::remove(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::search_n(std::begin(arr), std::end(arr), 1, 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::search_n(std::begin(arr), std::end(arr), 1, 1, std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::search(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::search(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::greater()); #if TEST_STD_VER >= 17 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::search(std::begin(arr), std::end(arr), std::default_searcher(std::begin(arr), std::end(arr))); #endif - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::unique(std::begin(arr), std::end(arr)); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::unique(std::begin(arr), std::end(arr), std::greater()); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::upper_bound(std::begin(arr), std::end(arr), 1); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::upper_bound(std::begin(arr), std::end(arr), 1, std::greater()); } template void test_template_cast_wrappers(LV&& lv, RV&& rv) { - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::forward(lv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::forward(rv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::move(lv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::move(rv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::move_if_noexcept(lv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::move_if_noexcept(rv); #if TEST_STD_VER >= 17 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::as_const(lv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::as_const(rv); #endif #if TEST_STD_VER >= 20 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::identity()(lv); - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::identity()(rv); #endif } @@ -326,18 +326,18 @@ { #if TEST_STD_VER > 14 std::byte b{42}; - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::to_integer(b); #endif #if TEST_STD_VER > 17 - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::bit_cast(42); #endif #if TEST_STD_VER > 20 enum E { Apple, Orange } e = Apple; - // expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} std::to_underlying(e); #endif }