summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/guality/pr46815.C
blob: 41b9219955d857931310330c5230ae31fb24a1a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// PR debug/46815
// { dg-do run }
// { dg-options "-g" }
// { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } }

struct S
{
  int i;
  S () { i = 42; }
  virtual void foo (void) {}
};

S
bar ()
{
  S s;
  return s;	// { dg-final { gdb-test 17 "s.i" "42" } }
}

int
main ()
{
  S s = bar ();
  return s.i - 42;
}