re PR c++/36960 (Reference variable in virtually inherited base corrupted under optimization)
2010-07-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/36960 * g++.dg/torture/pr36960.C: New testcase. From-SVN: r162141
This commit is contained in:
parent
6368f16604
commit
85e5e340be
@ -1,3 +1,8 @@
|
||||
2010-07-13 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/36960
|
||||
* g++.dg/torture/pr36960.C: New testcase.
|
||||
|
||||
2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/44908
|
||||
|
22
gcc/testsuite/g++.dg/torture/pr36960.C
Normal file
22
gcc/testsuite/g++.dg/torture/pr36960.C
Normal file
@ -0,0 +1,22 @@
|
||||
// { dg-do run }
|
||||
|
||||
struct Lower {
|
||||
const int& ref;
|
||||
Lower(const int& ref) : ref(ref) { }
|
||||
};
|
||||
struct Middle : public virtual Lower {
|
||||
Middle(const int& ref) : Lower(ref) { }
|
||||
};
|
||||
struct Upper : public Middle {
|
||||
Upper(const int& ref) : Lower(ref), Middle(ref) { }
|
||||
int get() { return ref; }
|
||||
};
|
||||
extern "C" void abort (void);
|
||||
int main()
|
||||
{
|
||||
int i = 0;
|
||||
Upper upper(i);
|
||||
if (upper.get() != 0)
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user