[testsuite] Fix -Wreturn-type fallout in g++.dg/cpp0x/rv-trivial-bug.C on Solaris 10

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Nov 14 10:45:00 GMT 2017


Currently, g++.dg/cpp0x/rv-trivial-bug.C FAILs on Solaris 10 only:

+FAIL: g++.dg/cpp0x/rv-trivial-bug.C  -std=c++11 (test for excess errors)
+FAIL: g++.dg/cpp0x/rv-trivial-bug.C  -std=c++14 (test for excess errors)

/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/rv-trivial-bug.C:27:1: warning: no return statement in function returning non-void [-Wreturn-type]

This happens as follows: the last assert() in test2() expands to

   (void)((
   move_assign == 1
   ) || (__assert_c99(
   "move_assign == 1"
   , "/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/rv-trivial-bug.C", 26, __func__), 0))

and unlike the Solaris 11 <assert.h>, the Solaris 10 one doesn't mark
__assert_c99 as noreturn.  Fixed by adding a return value.  Tested with
the appropriate runtest invocation on i386-pc-solaris2.10,
i386-pc-solaris2.11, and x86_64-pc-linux-gnu.

Will commit shortly unless someone objects.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-11-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* g++.dg/cpp0x/rv-trivial-bug.C (test2): Return a value.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtb.patch
Type: text/x-patch
Size: 362 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171114/09c11387/attachment.bin>


More information about the Gcc-patches mailing list