mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
f106e10e5e
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.
49 lines
542 B
C++
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();
|
|
}
|