| 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 |
| 5 |
|
| 6 |
// Ensure that XML we generate is not invalid. |
| 7 |
// RUN: FileCheck %s -check-prefix=WRONG < %t/out |
| 8 |
// WRONG-NOT: CommentXMLInvalid |
| 9 |
|
| 10 |
/** |
| 11 |
* \brief Aaa |
| 12 |
*/ |
| 13 |
template<typename T> struct A { |
| 14 |
/** |
| 15 |
* \brief Bbb |
| 16 |
*/ |
| 17 |
A(); |
| 18 |
/** |
| 19 |
* \brief Ccc |
| 20 |
*/ |
| 21 |
~A(); |
| 22 |
/** |
| 23 |
* \brief Ddd |
| 24 |
*/ |
| 25 |
void f() { } |
| 26 |
}; |
| 27 |
// CHECK: <Declaration>template <typename T> struct A {}</Declaration> |
| 28 |
// CHECK: <Declaration>A<T>()</Declaration> |
| 29 |
// CHECK: <Declaration>~A<T>()</Declaration> |
| 30 |
|
| 31 |
/** |
| 32 |
* \Brief Eee |
| 33 |
*/ |
| 34 |
template <typename T> struct D : A<T> { |
| 35 |
/** |
| 36 |
* \brief |
| 37 |
*/ |
| 38 |
using A<T>::f; |
| 39 |
|
| 40 |
void f(); |
| 41 |
}; |
| 42 |
// CHECK: <Declaration>template <typename T> struct D : A<T> {}</Declaration> |
| 43 |
// CHECK: <Declaration>using A<T>::f</Declaration> |
| 44 |
|
| 45 |
struct Base { |
| 46 |
int foo; |
| 47 |
}; |
| 48 |
/** |
| 49 |
* \brief |
| 50 |
*/ |
| 51 |
template<typename T> struct E : Base { |
| 52 |
/** |
| 53 |
* \brief |
| 54 |
*/ |
| 55 |
using Base::foo; |
| 56 |
}; |
| 57 |
// CHECK: <Declaration>template <typename T> struct E : Base {}</Declaration> |
| 58 |
// CHECK: <Declaration>using Base::foo</Declaration> |
| 59 |
|
| 60 |
/// \tparam |
| 61 |
/// \param AAA Blah blah |
| 62 |
template<typename T> |
| 63 |
void func_template_1(T AAA); |
| 64 |
// CHECK: <Declaration>template <typename T> void func_template_1(T AAA)</Declaration> |
| 65 |
|
| 66 |
template<template<template<typename CCC> class DDD, class BBB> class AAA> |
| 67 |
void func_template_2(); |
| 68 |
// FIXME: There is not Declaration field in the generated output. |
| 69 |
|
| 70 |
namespace rdar16128173 { |
| 71 |
// CHECK: <Declaration>template <class PtrTy> class OpaquePtr {}</Declaration> |
| 72 |
|
| 73 |
/// \brief Wrapper for void* pointer. |
| 74 |
/// \tparam PtrTy Either a pointer type like 'T*' or a type that behaves like |
| 75 |
/// a pointer. |
| 76 |
template <class PtrTy> |
| 77 |
class OpaquePtr {}; |
| 78 |
|
| 79 |
// CHECK: <Declaration>typedef OpaquePtr<int> DeclGroupPtrTy</Declaration> |
| 80 |
typedef OpaquePtr<int> DeclGroupPtrTy; |
| 81 |
|
| 82 |
DeclGroupPtrTy blah; |
| 83 |
} |