Debian Codegraph @

gcc/testsuite/g++.dg/ipa/pr43812.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fwhole-program -fipa-cp" } */
3
4 typedef float scoord_t;
5 typedef scoord_t sdist_t;
6 typedef sdist_t dist_t;
7 template<typename T> class TRay { };
8 typedef TRay<dist_t> Ray;
9 class BBox { };
10 class RenderContext { };
11 class RefCounted {
12 public:
13 void deref () const {
14 if (--ref_count <= 0) {
15 delete this;
16 }
17 }
18 mutable int ref_count;
19 };
20 template<class T> class Ref {
21 public:
22 ~Ref () {
23 if (obj) obj->deref ();
24 }
25 T *obj;
26 };
27 class Material : public RefCounted { };
28 class Surface {
29 public:
30 virtual ~Surface () { }
31 class IsecInfo { };
32 virtual const IsecInfo *intersect (Ray &ray, RenderContext &context) const;
33 Ref<const Material> material;
34 };
35 class LocalSurface : public Surface {
36 virtual BBox bbox () const;
37 };
38 BBox LocalSurface::bbox () const { return BBox(); }