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