brintos

brintos / llvm-project-archived public Read only

0
0
Text · 674 B · c952ef8 Raw
44 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused %s2// expected-no-diagnostics3 4// Tests that overload resolution is treated as an unevaluated context.5// PR55416struct Foo7{8    Foo *next;9};10 11template <typename>12struct Bar13{14};15 16 17template <typename T>18class Wibble19{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 It29    {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