aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr27090.C
blob: 0fb46f35db70fcf194c858c23413987a13a87320 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */

template <class T>
struct Bar
{
        int get() { return static_cast<T*>(this)->get2(); }
};
struct Foo : public Bar<Foo>
{
        int get2() { return x; }
        int x;
};

int foo(Foo& f)
{
        return f.get();
}

/* { dg-final { scan-tree-dump "f_..D.->x;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */