aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/trailing8.C
blob: 304845e66d8cad5aa7547217505b0f44e8b2859c (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 c++/54359
// { dg-require-effective-target c++11 }

int& ref(int& x) { return x; }
const int& ref(const int& x) { return x; }

class A {
    int x;
    int f() const;
    auto test1() const -> decltype(this);
    auto test2() const -> decltype(ref(x));
    auto test3() const -> decltype(f());
};

auto A::test1() const -> decltype(this) {
    return this;
}

auto A::test2() const -> decltype(ref(x)) {
    return ref(x);
}

auto A::test3() const -> decltype(f()) {
    return f();
}