annotate gcc/testsuite/g++.dg/warn/Wreturn-type-11.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
1 // PR c++/88554
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
2 // { dg-do compile }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
3 // { dg-options "-Wreturn-type" }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
4
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
5 struct X {
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
6 friend X & operator+= (X &, int) { } // { dg-warning "no return statement in function returning non-void" }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
7 // { dg-bogus "return \\*this;" "" { target *-*-* } .-1 }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
8 };
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
9 struct Y {};
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
10 Y & operator += (Y &, Y &) { } // { dg-warning "no return statement in function returning non-void" }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
11 // { dg-bogus "return \\*this;" "" { target *-*-* } .-1 }