blob: 67da8342f26b42b081fbdec54785ed194268c885 [file] [log] [blame]
Gabor Greifc620ace2010-08-27 23:39:49 +00001// RUN: %clang %s -S -emit-llvm -o - | grep -e "define linkonce_odr.*_ZN6pr8007lsERNS_11std_ostreamERKNS_8StreamerINS_3FooEEE"
2// XFAIL: *
3
4namespace pr8007 {
5
6struct std_ostream
7{
8 int dummy;
9};
10
11std_ostream cout;
12
13template <typename STRUCT_TYPE>
14struct Streamer
15{
16 friend std_ostream& operator << (std_ostream& o, const Streamer& f)
17 {
18 Streamer s(f);
19 s(o);
20 return o;
21 }
22
23 Streamer(const STRUCT_TYPE& s) : s(s) {}
24
25 const STRUCT_TYPE& s;
26 void operator () (std_ostream&) const;
27};
28
29typedef struct Foo {} Foo;
30
31std_ostream& operator << (std_ostream& o, const Streamer<Foo>& f);
32/*std_ostream& operator << (std_ostream& o, const Streamer<Foo>& f)
33{
34 // Sema should flag this as a redefinition
35}*/
36
37template <>
38void Streamer<Foo>::operator () (std_ostream& o) const
39{
40}
41
42} // namespace pr8007
43
44int main(void)
45{
46 using namespace pr8007;
47 Foo foo;
48 cout << foo;
49}