Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/torture/pr82060.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// { dg-do compile } struct A { char a[1]; // must be char array }; struct B { A& a() { return ma; } // must be accessed through a getter A ma; }; struct C { B& b() { return mb; } // must be accessed through a getter B mb; }; struct D { virtual A getA() = 0; // must be virtual }; void foo(D& d) // The D object must not be created locally // (so that getA implementation is not known at compile time?) { C c; for (;;) // must be in a loop c.b().a() = d.getA(); }