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
18 * \brief plain c++ class
24 * \brief plain c++ constructor
26 Test () : reserved (new data()) {}
29 * \brief plain c++ member function
31 unsigned getID() const
33 return reserved
->objectID
;
36 * \brief plain c++ destructor
44 * \brief plain c++ data field
48 // CHECK: <Declaration>class Test {}</Declaration>
49 // CHECK: <Declaration>Test()</Declaration>
50 // CHECK: <Declaration>unsigned int getID() const</Declaration>
51 // CHECK: <Declaration>~Test(){{( noexcept)?}}</Declaration>
52 // CHECK: <Declaration>data *reserved</Declaration>
68 friend int int_func();
73 friend bool operator==(const Test
&, const Test
&);
78 template <typename T
> friend void TemplateFriend();
83 template <typename T
> friend class TemplateFriendClass
;
86 // CHECK: <Declaration>friend class Test</Declaration>
87 // CHECK: <Declaration>friend void foo()</Declaration>
88 // CHECK: <Declaration>friend int int_func()</Declaration>
89 // CHECK: <Declaration>friend bool operator==(const Test &, const Test &)</Declaration>
90 // CHECK: <Declaration>friend template <typename T> void TemplateFriend()</Declaration>
91 // CHECK: <Declaration>friend template <typename T> class TemplateFriendClass</Declaration>
102 friend void ns::f(int a
);
105 // CHECK: <Declaration>friend void ns::f(int a)</Declaration>
108 template <class T
> struct Outer
{
114 friend void Outer::foo(T
);
118 // CHECK: <Declaration>friend void Outer<T>::foo(T)</Declaration>
129 friend void ::test2::foo::Func(int x
);
132 // CHECK: <Declaration>friend void ::test2::foo::Func(int x)</Declaration>
135 template<class T
> class vector
{
141 void f(const T
& t
= T()) {}
148 friend void vector
<A
>::f(const A
&);
151 // CHECK: <Declaration>void f(const T &t = T())</Declaration>
152 // CHECK: <Declaration>friend void vector<A>::f(const A &)</Declaration>
157 * \brief plain friend test.
159 friend class MyClass
;
161 // CHECK: <Declaration>friend class MyClass</Declaration>
163 template<class _Tp
> class valarray
167 * \brief template friend test.
169 template <class T
> friend class valarray
;
171 // CHECK: <Declaration>template <class T> class valarray</Declaration>
172 // CHECK: <Declaration>friend template <class T> class valarray</Declaration>
176 valarray
<unsigned> __size_
;