binutils-gdb/gdb/testsuite/gdb.cp/shadow.cc
Thomas Preud'homme f106e10e5e [gdb/testsuite] Fix wrong return type in tests
The following tests are marked untested with latest GCC due to a warning
being emitted for a mismatch between their return type and what the lack
of return statement:

* gdb.cp/breakpoint.exp
* gdb.cp/psymtab-parameter.exp
* gdb.cp/shadow.exp

This patch fix the return type to match the function definitions.

2017-11-29  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gdb/testsuite/
	* gdb.cp/breakpoint.cc (bar): Set return type to void.
	* gdb.cp/psymtab-parameter.cc (func): Likewise.
	* gdb.cp/psymtab-parameter.exp: Update comment regarding prototype of
	func ().
	* gdb.cp/shadow.cc (B.func): Return 0.
2017-11-29 10:45:31 +00:00

49 lines
542 B
C++

namespace A
{
int x = 11;
}
int x = 22;
int y = 0;
class B
{
public:
int x;
int
func()
{
x = 33;
y++; // marker1
{
int x = 44;
y++; // marker2
{
int x = 55;
y++; // marker3
{
using namespace A;
y++; // marker4
{
using A::x;
y++; // marker5
}
}
}
}
return 0;
}
};
int
main()
{
B theB;
return theB.func();
}