summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/pr45908.C
blob: 3a8508890ee1839a347e5cc28b14698513caa31d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/45908
// Testcase by Jonathan Wakely <redi@gcc.gnu.org>

// { dg-do compile }
// { dg-options "-std=c++0x" }

struct vector {
    struct iterator { };
    struct const_iterator { };
    iterator begin();
    const_iterator begin() const;
};

class block {
    vector v;
    auto end() const -> decltype(v.begin())
    { return v.begin(); } // { dg-error "could not convert" }
};