add more test with qualifications

git-svn-id: http://root.cern.ch/svn/root/trunk@48795 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Philippe Canal 2013-03-01 19:05:54 +00:00
parent 90685e1db3
commit 5b7940b35d

View File

@ -65,6 +65,8 @@ namespace {
};
}
using namespace std;
class Embedded_objects {
public:
enum Eenum {
@ -95,8 +97,24 @@ public:
typedef std::vector<int> vecint;
vecint::iterator m_iter;
const Eenum m_enum;
typedef vector<int> vecint2;
vecint2::iterator m_iter2;
};
namespace NS1 {
namespace NS2 {
namespace NS3 {
class Point {};
class Inner3 {
public:
Point p1;
NS3::Point p2;
::NS1::NS2::NS3::Point p3;
};
}
}
}
.rawInput 0
const cling::LookupHelper& lookup = gCling->getLookupHelper();
@ -290,6 +308,7 @@ if (decl) {
// CHECK: Embedded_objects::EmbeddedClasses::Embedded6
// CHECK: std::vector<int>::iterator
// CHECK: const Embedded_objects::Eenum
// CHECK: std::vector<int>::iterator
// In the partial desugaring add support for the case where we have a type
// that point to an already completely desugared template instantiation in
@ -317,6 +336,29 @@ if (const clang::RecordDecl *rdecl = llvm::dyn_cast_or_null<clang::RecordDecl>(d
// CHECK: Details::Impl
// CHECK: std::vector<Details::Impl, std::allocator<Details::Impl> >
decl=lookup.findScope("NS1::NS2::NS3::Inner3",&t);
if (decl) {
const clang::CXXRecordDecl *cxxdecl
= llvm::dyn_cast<clang::CXXRecordDecl>(decl);
if (cxxdecl) {
clang::DeclContext::decl_iterator iter = cxxdecl->decls_begin();
while ( *iter ) {
const clang::Decl *mdecl = *iter;
if (const clang::ValueDecl *vd = llvm::dyn_cast<clang::ValueDecl>(mdecl)) {
clang::QualType vdType = vd->getType();
name.clear();
Transform::GetPartiallyDesugaredType(Ctx,vdType,skip).getAsStringInternal(name,Policy);
std::cout << name.c_str() << std::endl;
}
++iter;
}
}
}
// CHECK: NS1::NS2::NS3::Point
// CHECK: NS1::NS2::NS3::Point
// CHECK: NS1::NS2::NS3::Point
decl = lookup.findScope("cmap<volatile int,volatile int>",&t);
QT = clang::QualType(t, 0);
std::cout << Transform::GetPartiallyDesugaredType(Ctx, QT, skip).getAsString().c_str() << std::endl;