2016-09-26 François Dumont <fdumont@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / g++.dg / conversion / cond4.C
blob3bd64763a1835359cfff97cd449517d553fc433d
1 // Origin: PR c++/45383
2 // { dg-do run }
4 struct null {
5     null() {}
6     template<class T>
7     operator T*() const {
8     return 0;
9     }
11     template<class C, class T>
12     operator T C::*() const {
13     return 0;
14     }
15 private:
16     null(const null&);
17     null& operator=(const null&);
18     void operator&() const;
21 static struct null null;
23 int
24 main()
26     int* ptr = null;
27     if (ptr == null)
28         return 0;
29     if (ptr != null)
30         return 1;