selftest::fail and selftest::fail_formatted call abort.  Marking
them as "noreturn" can help eliminate false warnings about unreachable
code in selftests.

Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.

OK for trunk?

gcc/ChangeLog:
        * selftest.h (selftest::fail): Add __attribute__ ((noreturn)).
        (selftest::fail_formatted): Likewise.
---
 gcc/selftest.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/selftest.h b/gcc/selftest.h
index b073ed6..8636997 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -56,12 +56,13 @@ extern void pass (const location &loc, const char *msg);
 
 /* Report the failed outcome of some aspect of the test and abort.  */
 
-extern void fail (const location &loc, const char *msg);
+extern void fail (const location &loc, const char *msg)
+  __attribute__ ((noreturn));
 
 /* As "fail", but using printf-style formatted output.  */
 
 extern void fail_formatted (const location &loc, const char *fmt, ...)
- ATTRIBUTE_PRINTF_2;
+  ATTRIBUTE_PRINTF_2 __attribute__ ((noreturn));
 
 /* Implementation detail of ASSERT_STREQ.  */
 
-- 
1.8.5.3

Reply via email to