3 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out
4 // RUN: FileCheck %s < %t/out
5 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 -std=c++98 %s > %t/98
6 // RUN: FileCheck %s < %t/98
7 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 -std=c++11 %s > %t/11
8 // RUN: FileCheck %s < %t/11
10 // Ensure that XML we generate is not invalid.
11 // RUN: FileCheck %s -check-prefix=WRONG < %t/out
12 // RUN: FileCheck %s -check-prefix=WRONG < %t/98
13 // RUN: FileCheck %s -check-prefix=WRONG < %t/11
14 // WRONG-NOT: CommentXMLInvalid
17 * \brief plain c++ class
23 * \brief plain c++ constructor
25 Test () : reserved (new data()) {}
28 * \brief plain c++ member function
30 unsigned getID() const
32 return reserved
->objectID
;
35 * \brief plain c++ destructor
43 * \brief plain c++ data field
47 // CHECK: <Declaration>class Test {}</Declaration>
48 // CHECK: <Declaration>Test()</Declaration>
49 // CHECK: <Declaration>unsigned int getID() const</Declaration>
50 // CHECK: <Declaration>~Test(){{( noexcept)?}}</Declaration>
51 // CHECK: <Declaration>data *reserved</Declaration>
67 friend int int_func();
72 friend bool operator==(const Test
&, const Test
&);
77 template <typename T
> friend void TemplateFriend();
82 template <typename T
> friend class TemplateFriendClass
;
85 // CHECK: <Declaration>friend class Test</Declaration>
86 // CHECK: <Declaration>friend void foo()</Declaration>
87 // CHECK: <Declaration>friend int int_func()</Declaration>
88 // CHECK: <Declaration>friend bool operator==(const Test &, const Test &)</Declaration>
89 // CHECK: <Declaration>friend template <typename T> void TemplateFriend()</Declaration>
90 // CHECK: <Declaration>friend template <typename T> class TemplateFriendClass</Declaration>
101 friend void ns::f(int a
);
104 // CHECK: <Declaration>friend void ns::f(int a)</Declaration>
107 template <class T
> struct Outer
{
113 friend void Outer::foo(T
);
117 // CHECK: <Declaration>friend void Outer<T>::foo(T)</Declaration>
128 friend void ::test2::foo::Func(int x
);
131 // CHECK: <Declaration>friend void ::test2::foo::Func(int x)</Declaration>
134 template<class T
> class vector
{
140 void f(const T
& t
= T()) {}
147 friend void vector
<A
>::f(const A
&);
150 // CHECK: <Declaration>void f(const T &t = T())</Declaration>
151 // CHECK: <Declaration>friend void vector<A>::f(const A &)</Declaration>
156 * \brief plain friend test.
158 friend class MyClass
;
160 // CHECK: <Declaration>friend class MyClass</Declaration>
162 template<class _Tp
> class valarray
166 * \brief template friend test.
168 template <class T
> friend class valarray
;
170 // CHECK: <Declaration>template <class T> class valarray</Declaration>
171 // CHECK: <Declaration>friend template <class T> class valarray</Declaration>
175 valarray
<unsigned> __size_
;