File: comment-cplus-template-decls.cpp

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (84 lines) | stat: -rw-r--r-- 2,020 bytes parent folder | download | duplicates (29)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// RUN: rm -rf %t
// RUN: mkdir %t
// 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
// RUN: FileCheck %s < %t/out

// Ensure that XML we generate is not invalid.
// RUN: FileCheck %s -check-prefix=WRONG < %t/out
// WRONG-NOT: CommentXMLInvalid
// rdar://12378714

/**
 * \brief Aaa
*/
template<typename T> struct A {
/**
 * \brief Bbb
*/
  A();
/**
 * \brief Ccc
*/
  ~A();
/**
 * \brief Ddd
*/
  void f() { }
};
// CHECK: <Declaration>template &lt;typename T&gt; struct A {}</Declaration>
// CHECK: <Declaration>A&lt;T&gt;()</Declaration>
// CHECK: <Declaration>~A&lt;T&gt;()</Declaration>

/**
 * \Brief Eee
*/
template <typename T> struct D : A<T> {
/**
 * \brief
*/
  using A<T>::f;
  
  void f();
};
// CHECK: <Declaration>template &lt;typename T&gt; struct D :  A&lt;T&gt; {}</Declaration>
// CHECK: <Declaration>using A&lt;T&gt;::f</Declaration>

struct Base {
    int foo;
};
/**
 * \brief
*/
template<typename T> struct E : Base {
/**
 * \brief
*/
  using Base::foo;
};
// CHECK: <Declaration>template &lt;typename T&gt; struct E :  Base {}</Declaration>
// CHECK: <Declaration>using Base::foo</Declaration>

/// \tparam
/// \param AAA Blah blah
template<typename T>
void func_template_1(T AAA);
// CHECK: <Declaration>template &lt;typename T&gt; void func_template_1(T AAA)</Declaration>

template<template<template<typename CCC> class DDD, class BBB> class AAA>
void func_template_2();
// FIXME: There is not Declaration field in the generated output.

namespace rdar16128173 {
// CHECK: <Declaration>template &lt;class PtrTy&gt; class OpaquePtr {}</Declaration>

/// \brief Wrapper for void* pointer.
/// \tparam PtrTy Either a pointer type like 'T*' or a type that behaves like
///               a pointer.
template <class PtrTy>
class OpaquePtr {};

// CHECK: <Declaration>typedef OpaquePtr&lt;int&gt; DeclGroupPtrTy</Declaration>
typedef OpaquePtr<int> DeclGroupPtrTy;

DeclGroupPtrTy blah;
}