view gcc/testsuite/g++.dg/cpp0x/trailing8.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

// 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();
}