summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/cond4.C
blob: 3bd64763a1835359cfff97cd449517d553fc433d (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
26
27
28
29
30
31
// Origin: PR c++/45383
// { dg-do run }

struct null {
    null() {}
    template<class T>
    operator T*() const {
    return 0;
    }

    template<class C, class T>
    operator T C::*() const {
    return 0;
    }
private:
    null(const null&);
    null& operator=(const null&);
    void operator&() const;
};

static struct null null;

int
main()
{
    int* ptr = null;
    if (ptr == null)
        return 0;
    if (ptr != null)
        return 1;
}