More C++ testing of declarations embedded in

<declaration> tag of Comment XML  and fixing 
DeclPrint of templates along the way - wip. 
//rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Fariborz Jahanian 2012-12-06 00:09:40 +00:00
Родитель 4fb10d1c67
Коммит 5e0ea1994b
2 изменённых файлов: 45 добавлений и 1 удалений

Просмотреть файл

@ -1122,7 +1122,7 @@ DeclPrinter::VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D) {
void DeclPrinter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) {
Out << "using ";
D->getQualifier()->print(Out, Policy);
Out << D->getDeclName();
Out << D->getName();
}
void DeclPrinter::VisitUsingShadowDecl(UsingShadowDecl *D) {

Просмотреть файл

@ -0,0 +1,44 @@
// 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 {\n}</Declaration>
// CHECL: <Declaration>A&lt;T&gt;()</Declaration>
// CHECK: <Declaration>void ~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; {\n}</Declaration>
// CHECK: <Declaration>using A&lt;T&gt;::f</Declaration>