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