From 2df0c2315a21a05838c8015d27678d236f4d0cd4 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 1 Nov 2019 16:12:30 -0400 Subject: Fix nodiscard test failures. * g++.dg/cpp2a/nodiscard-once.C: Expect nodiscard warning. * g++.dg/cpp2a/nodiscard-reason.C: Adjust expected warnings. From-SVN: r277719 --- gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C | 2 +- gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C index b9dde5c..7834971 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C @@ -7,6 +7,6 @@ void test (void) { - check1 (); + check1 (); // { dg-warning "nodiscard" } (void) check1 (); } diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C index e0230b1..5fda058 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C @@ -13,8 +13,8 @@ typedef struct { char big[1024]; fnt fn; } C; struct [[nodiscard("exact_D_message")]] D { int i; D(); ~D(); }; NODIS E check1 (void); -NODIS void check2 (void); /* { dg-warning "10:.nodiscard\[^\n\r]*exact_message" } */ -NODIS int foo; /* { dg-warning "9:.nodiscard\[^\n\r]*exact_message" } */ +NODIS void check2 (void); /* { dg-warning "12:.nodiscard\[^\n\r]*void" } */ +NODIS int foo; /* { dg-warning "11:.nodiscard\[^\n\r]*class" } */ int bar (void); NODISAI E check3 (void) { return (E)bar (); } NODIS A check4 (void); @@ -173,23 +173,23 @@ test (void) return; i += (k ? check3 : check11) (); i += ({ (k ? check3 : check11) (); }); - (k ? check3 : check11) (); /* { dg-warning "nodiscard\[^\n\r]*exact_inline_message" } */ + (k ? check3 : check11) (); /* { dg-warning "nodiscard\[^\n\r]*exact_E_message" } */ (void) (k ? check3 : check11) (); - (k ? check3 : check11) (), bar (); /* { dg-warning "nodiscard\[^\n\r]*exact_inline_message" } */ + (k ? check3 : check11) (), bar (); /* { dg-warning "nodiscard\[^\n\r]*exact_E_message" } */ if (pcheck1 ()) return; i += pcheck1 (); i += ({ pcheck1 (); }); - pcheck1 (); /* { dg-warning "nodiscard\[^\n\r]*exact_E_message" } */ + pcheck1 (); /* { dg-warning "nodiscard\[^\n\r]*exact_" } */ (void) pcheck1 (); - pcheck1 (), bar (); /* { dg-warning "nodiscard\[^\n\r]*exact_E_message" } */ + pcheck1 (), bar (); /* { dg-warning "nodiscard\[^\n\r]*exact_" } */ if (pcheck3 ()) return; i += pcheck3 (); i += ({ pcheck3 (); }); - pcheck3 (); /* { dg-warning "nodiscard\[^\n\r]*exact_E_message" } */ + pcheck3 (); /* { dg-warning "nodiscard\[^\n\r]*exact_" } */ (void) pcheck3 (); - pcheck3 (), bar (); /* { dg-warning "nodiscard\[^\n\r]*exact_E_message" } */ + pcheck3 (), bar (); /* { dg-warning "nodiscard\[^\n\r]*exact_" } */ d = check12 (); if (d.i) return; -- cgit v1.1