[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Index / comment-cplus-template-decls.cpp
blob7ef09bd691b12fa609fea7c90d0b551049fdb018
1 // 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
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
11 /**
12 * \brief Aaa
14 template<typename T> struct A {
15 /**
16 * \brief Bbb
18 A();
19 /**
20 * \brief Ccc
22 ~A();
23 /**
24 * \brief Ddd
26 void f() { }
28 // CHECK: <Declaration>template &lt;typename T&gt; struct A {}</Declaration>
29 // CHECK: <Declaration>A&lt;T&gt;()</Declaration>
30 // CHECK: <Declaration>~A&lt;T&gt;()</Declaration>
32 /**
33 * \Brief Eee
35 template <typename T> struct D : A<T> {
36 /**
37 * \brief
39 using A<T>::f;
41 void f();
43 // CHECK: <Declaration>template &lt;typename T&gt; struct D : A&lt;T&gt; {}</Declaration>
44 // CHECK: <Declaration>using A&lt;T&gt;::f</Declaration>
46 struct Base {
47 int foo;
49 /**
50 * \brief
52 template<typename T> struct E : Base {
53 /**
54 * \brief
56 using Base::foo;
58 // CHECK: <Declaration>template &lt;typename T&gt; struct E : Base {}</Declaration>
59 // CHECK: <Declaration>using Base::foo</Declaration>
61 /// \tparam
62 /// \param AAA Blah blah
63 template<typename T>
64 void func_template_1(T AAA);
65 // CHECK: <Declaration>template &lt;typename T&gt; void func_template_1(T AAA)</Declaration>
67 template<template<template<typename CCC> class DDD, class BBB> class AAA>
68 void func_template_2();
69 // FIXME: There is not Declaration field in the generated output.
71 namespace rdar16128173 {
72 // CHECK: <Declaration>template &lt;class PtrTy&gt; class OpaquePtr {}</Declaration>
74 /// \brief Wrapper for void* pointer.
75 /// \tparam PtrTy Either a pointer type like 'T*' or a type that behaves like
76 /// a pointer.
77 template <class PtrTy>
78 class OpaquePtr {};
80 // CHECK: <Declaration>typedef OpaquePtr&lt;int&gt; DeclGroupPtrTy</Declaration>
81 typedef OpaquePtr<int> DeclGroupPtrTy;
83 DeclGroupPtrTy blah;