blob: c952ef8ec7c452727dcc8dffa6088b69006228cf [file] [log] [blame]
Chandler Carruth9b106832011-08-17 09:49:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Douglas Gregor7edfb692009-11-23 12:27:39 +00003
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}