1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused %s
2
3// Tests that overload resolution is treated as an unevaluated context.
4// PR5541
5struct Foo
6{
7    Foo *next;
8};
9
10template <typename>
11struct Bar
12{
13};
14
15
16template <typename T>
17class Wibble
18{
19    typedef Bar<T> B;
20
21    static inline B *concrete(Foo *node) {
22        int a[sizeof(T) ? -1 : -1];
23        return reinterpret_cast<B *>(node);
24    }
25
26public:
27    class It
28    {
29        Foo *i;
30
31    public:
32        inline operator B *() const { return concrete(i); }
33        inline bool operator!=(const It &o) const { return i !=
34o.i; }
35    };
36};
37
38void f() {
39  Wibble<void*>::It a, b;
40
41  a != b;
42}
43