blob: 8d8a2f42cf283cb807334509b46945a9d83d6408 [file] [log] [blame]
Chandler Carruth9b106832011-08-17 09:49:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused %s
Douglas Gregor7edfb692009-11-23 12:27:39 +00002
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}