blob: 892f649ef7a6911d16f3253ffa8951076188b1a2 [file] [log] [blame]
Douglas Gregord8ac4362009-05-18 22:38:38 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3template<typename T>
4struct ImaginaryLiteral0 {
5 void f(T &x) {
6 x = 3.0I; // expected-error{{incompatible type}}
7 }
8};
9
10template struct ImaginaryLiteral0<_Complex float>;
11template struct ImaginaryLiteral0<int*>; // expected-note{{instantiation}}
Douglas Gregor6731c312009-05-19 20:02:01 +000012
13namespace N1 {
14 struct X { };
15
16 int& operator+=(X&, int); // expected-note{{candidate}}
17}
18
19namespace N2 {
20 long& operator+=(N1::X&, long); // expected-note{{candidate}}
21
22 template<typename T, typename U, typename Result>
23 struct PlusEquals0 {
24 void f(T t, U u) {
25 Result r = t += u; // expected-error{{ambiguous}}
26 }
27 };
28}
29
30namespace N3 {
31 struct Y : public N1::X {
32 short& operator+=(long); // expected-note{{candidate}}
33 };
34}
35
36template struct N2::PlusEquals0<N1::X, int, int&>;
37template struct N2::PlusEquals0<N1::X, long, long&>;
38template struct N2::PlusEquals0<N3::Y, long, short&>;
39template struct N2::PlusEquals0<int, int, int&>;
40template struct N2::PlusEquals0<N3::Y, int, short&>; // expected-note{{instantiation}}