blob: 7ef09bd691b12fa609fea7c90d0b551049fdb018 [file] [log] [blame]
Fariborz Jahanian3ec39212012-12-06 00:09:40 +00001// RUN: rm -rf %t
2// RUN: mkdir %t
3// 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/out
4// RUN: FileCheck %s < %t/out
5
6// Ensure that XML we generate is not invalid.
7// RUN: FileCheck %s -check-prefix=WRONG < %t/out
8// WRONG-NOT: CommentXMLInvalid
9// rdar://12378714
10
11/**
12 * \brief Aaa
13*/
14template<typename T> struct A {
15/**
16 * \brief Bbb
17*/
18 A();
19/**
20 * \brief Ccc
21*/
22 ~A();
23/**
24 * \brief Ddd
25*/
26 void f() { }
27};
Manuel Klimeke7d10a12013-01-10 13:24:24 +000028// CHECK: <Declaration>template &lt;typename T&gt; struct A {}</Declaration>
Fariborz Jahaniana14523f2012-12-06 17:50:40 +000029// CHECK: <Declaration>A&lt;T&gt;()</Declaration>
Benjamin Kramer2907b082014-02-25 18:49:49 +000030// CHECK: <Declaration>~A&lt;T&gt;()</Declaration>
Fariborz Jahanian3ec39212012-12-06 00:09:40 +000031
32/**
33 * \Brief Eee
34*/
35template <typename T> struct D : A<T> {
36/**
37 * \brief
38*/
39 using A<T>::f;
40
41 void f();
42};
Manuel Klimeke7d10a12013-01-10 13:24:24 +000043// CHECK: <Declaration>template &lt;typename T&gt; struct D : A&lt;T&gt; {}</Declaration>
Fariborz Jahanian3ec39212012-12-06 00:09:40 +000044// CHECK: <Declaration>using A&lt;T&gt;::f</Declaration>
Fariborz Jahanianb42b6f22012-12-06 00:57:28 +000045
46struct Base {
47 int foo;
48};
49/**
50 * \brief
51*/
52template<typename T> struct E : Base {
53/**
54 * \brief
55*/
56 using Base::foo;
57};
Manuel Klimeke7d10a12013-01-10 13:24:24 +000058// CHECK: <Declaration>template &lt;typename T&gt; struct E : Base {}</Declaration>
Fariborz Jahanianb42b6f22012-12-06 00:57:28 +000059// CHECK: <Declaration>using Base::foo</Declaration>
60
61/// \tparam
62/// \param AAA Blah blah
63template<typename T>
64void func_template_1(T AAA);
65// CHECK: <Declaration>template &lt;typename T&gt; void func_template_1(T AAA)</Declaration>
66
67template<template<template<typename CCC> class DDD, class BBB> class AAA>
68void func_template_2();
Manuel Klimeke7d10a12013-01-10 13:24:24 +000069// FIXME: There is not Declaration field in the generated output.
Argyrios Kyrtzidis7daabbd2014-04-27 22:53:03 +000070
71namespace rdar16128173 {
72// CHECK: <Declaration>template &lt;class PtrTy&gt; class OpaquePtr {}</Declaration>
73
74/// \brief Wrapper for void* pointer.
75/// \tparam PtrTy Either a pointer type like 'T*' or a type that behaves like
76/// a pointer.
77template <class PtrTy>
78class OpaquePtr {};
79
80// CHECK: <Declaration>typedef OpaquePtr&lt;int&gt; DeclGroupPtrTy</Declaration>
81typedef OpaquePtr<int> DeclGroupPtrTy;
82
83DeclGroupPtrTy blah;
84}