Fix const char * regexp.
This commit is contained in:
parent
0b6d047bb3
commit
d6dfcf82a8
@ -29,7 +29,7 @@ const clang::Decl* cl_A = lookup.findScope("A");
|
||||
printf("cl_A: 0x%lx\n", (unsigned long) cl_A);
|
||||
//CHECK: cl_A: 0x{{[1-9a-f][0-9a-f]*$}}
|
||||
cast<clang::NamedDecl>(cl_A)->getQualifiedNameAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "A"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "A"
|
||||
|
||||
.rawInput 1
|
||||
namespace N {
|
||||
@ -42,7 +42,7 @@ const clang::Decl* cl_A_in_N = lookup.findScope("N::A");
|
||||
printf("cl_A_in_N: 0x%lx\n", (unsigned long) cl_A_in_N);
|
||||
//CHECK: cl_A_in_N: 0x{{[1-9a-f][0-9a-f]*$}}
|
||||
cast<clang::NamedDecl>(cl_A_in_N)->getQualifiedNameAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "N::A"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "N::A"
|
||||
|
||||
|
||||
.rawInput 1
|
||||
@ -59,7 +59,7 @@ const clang::Decl* cl_A_in_NMP = lookup.findScope("N::M::P::A");
|
||||
cl_A_in_NMP
|
||||
//CHECK: (const clang::Decl *) 0x{{[1-9a-f][0-9a-f]*$}}
|
||||
cast<clang::NamedDecl>(cl_A_in_NMP)->getQualifiedNameAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "N::M::P::A"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "N::M::P::A"
|
||||
|
||||
|
||||
.rawInput 1
|
||||
@ -86,5 +86,5 @@ const clang::Type* resType = 0;
|
||||
lookup.findScope("W<Int_t>", &resType);
|
||||
//resType->dump();
|
||||
clang::QualType(resType,0).getAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "W<Int_t>"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "W<Int_t>"
|
||||
|
||||
|
@ -37,7 +37,7 @@ const clang::ClassTemplateDecl* tmplt_out = lookup.findClassTemplate("TmpltOutsi
|
||||
printf("tmplt_out: 0x%lx\n", (unsigned long) tmplt_out);
|
||||
//CHECK: tmplt_out: 0x{{[1-9a-f][0-9a-f]*$}}
|
||||
tmplt_out->getQualifiedNameAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "TmpltOutside"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "TmpltOutside"
|
||||
|
||||
|
||||
const clang::ClassTemplateDecl* tmplt_inside = lookup.findClassTemplate("OuterClass::TmpltInside");
|
||||
@ -45,7 +45,7 @@ const clang::ClassTemplateDecl* tmplt_inside = lookup.findClassTemplate("OuterCl
|
||||
printf("tmplt_inside: 0x%lx\n", (unsigned long) tmplt_out);
|
||||
//CHECK: tmplt_inside: 0x{{[1-9a-f][0-9a-f]*$}}
|
||||
tmplt_inside->getQualifiedNameAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "OuterClass::TmpltInside"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "OuterClass::TmpltInside"
|
||||
|
||||
|
||||
const clang::ClassTemplateDecl* tmplt_vec = lookup.findClassTemplate("std::vector");
|
||||
@ -53,5 +53,5 @@ const clang::ClassTemplateDecl* tmplt_vec = lookup.findClassTemplate("std::vecto
|
||||
printf("tmplt_vec: 0x%lx\n", (unsigned long) tmplt_vec);
|
||||
//CHECK: tmplt_vec: 0x{{[1-9a-f][0-9a-f]*$}}
|
||||
tmplt_vec->getQualifiedNameAsString().c_str()
|
||||
//CHECK-NEXT: ({{const char *|const_pointer}}) "std::{{(__1::)?}}vector"
|
||||
//CHECK-NEXT: ({{const char [*]|const_pointer}}) "std::{{(__1::)?}}vector"
|
||||
|
||||
|
@ -35,22 +35,22 @@ const cling::LookupHelper& lookup = gCling->getLookupHelper();
|
||||
|
||||
clang::QualType cl_A = lookup.findType("A");
|
||||
cl_A.getAsString().c_str()
|
||||
//CHECK: ({{const char *|const_pointer}}) "class A"
|
||||
//CHECK: ({{const char [*]|const_pointer}}) "class A"
|
||||
|
||||
clang::QualType cl_B_in_N = lookup.findType("N::B");
|
||||
cl_B_in_N.getAsString().c_str()
|
||||
//CHECK: ({{const char *|const_pointer}}) "N::B"
|
||||
//CHECK: ({{const char [*]|const_pointer}}) "N::B"
|
||||
|
||||
clang::QualType cl_C_in_M = lookup.findType("N::M::C");
|
||||
cl_C_in_M.getAsString().c_str()
|
||||
//CHECK: ({{const char *|const_pointer}}) "N::M::C"
|
||||
//CHECK: ({{const char [*]|const_pointer}}) "N::M::C"
|
||||
|
||||
clang::QualType builtin_int = lookup.findType("int");
|
||||
builtin_int.getAsString().c_str()
|
||||
//CHECK: ({{const char *|const_pointer}}) "int"
|
||||
//CHECK: ({{const char [*]|const_pointer}}) "int"
|
||||
|
||||
clang::QualType typedef_my_int = lookup.findType("my_int");
|
||||
typedef_my_int.getAsString().c_str()
|
||||
//CHECK: ({{const char *|const_pointer}}) "my_int"
|
||||
//CHECK: ({{const char [*]|const_pointer}}) "my_int"
|
||||
|
||||
.q
|
||||
|
@ -20,5 +20,5 @@ gCling->process("cling::Interpreter *DefaultInterp;");
|
||||
gCling->process("DefaultInterp = new cling::Interpreter(1, &argV);");
|
||||
gCling->process("DefaultInterp->process(\"#include \\\"cling/Interpreter/Interpreter.h\\\"\");");
|
||||
gCling->process("DefaultInterp->process(\"std::string s; gCling->createUniqueName(s); s.c_str()\");");
|
||||
// CHECK: ({{const char *|const_pointer}}) "__cling_Un1Qu31"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "__cling_Un1Qu31"
|
||||
.q
|
||||
|
@ -149,14 +149,14 @@ lookup.findScope("Details::Impl", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
//QT.getAsString().c_str()
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "Details::Impl"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "Details::Impl"
|
||||
|
||||
// Test the behavior for a class inside an anonymous namespace
|
||||
lookup.findScope("InsideAnonymous", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
//QT.getAsString().c_str()c
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "class <anonymous>::InsideAnonymous"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "class <anonymous>::InsideAnonymous"
|
||||
|
||||
// The above result is not quite want we want, so the client must using
|
||||
// the following:
|
||||
@ -169,22 +169,22 @@ Policy.SuppressScope = true; // Force the scope to be coming from a clang::
|
||||
std::string name;
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsStringInternal(name,Policy);
|
||||
name.c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "InsideAnonymous"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "InsideAnonymous"
|
||||
|
||||
// Test desugaring pointers types:
|
||||
QT = lookup.findType("Int_t*");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK:({{const char *|const_pointer}}) "int *"
|
||||
// CHECK:({{const char [*]|const_pointer}}) "int *"
|
||||
|
||||
QT = lookup.findType("const IntPtr_t*");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK:({{const char *|const_pointer}}) "int *const *"
|
||||
// CHECK:({{const char [*]|const_pointer}}) "int *const *"
|
||||
|
||||
|
||||
// Test desugaring reference (both r- or l- value) types:
|
||||
QT = lookup.findType("const IntPtr_t&");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK:({{const char *|const_pointer}}) "int *const &"
|
||||
// CHECK:({{const char [*]|const_pointer}}) "int *const &"
|
||||
|
||||
//TODO: QT = lookup.findType("IntPtr_t[32]");
|
||||
|
||||
@ -192,7 +192,7 @@ Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// Test desugaring reference (both r- or l- value) types:
|
||||
// QT = lookup.findType("const IntRef_t");
|
||||
// Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// should print:({{const char *|const_pointer}}) "int &const"
|
||||
// should print:({{const char [*]|const_pointer}}) "int &const"
|
||||
// but this is actually an illegal type:
|
||||
|
||||
// C++ [dcl.ref]p1:
|
||||
@ -205,122 +205,122 @@ Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
|
||||
QT = lookup.findType("const IntRef_t");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "int &"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "int &"
|
||||
|
||||
// Test desugaring reference (both r- or l- value) types:
|
||||
QT = lookup.findType("IntRef_t");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK:({{const char *|const_pointer}}) "int &"
|
||||
// CHECK:({{const char [*]|const_pointer}}) "int &"
|
||||
|
||||
|
||||
//Desugar template parameters:
|
||||
lookup.findScope("A<B<Double32_t, Int_t*> >", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK:({{const char *|const_pointer}}) "A<B<Double32_t, int *> >"
|
||||
// CHECK:({{const char [*]|const_pointer}}) "A<B<Double32_t, int *> >"
|
||||
|
||||
lookup.findScope("A<B<Double32_t, std::size_t*> >", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK:({{const char *|const_pointer}}) "A<B<Double32_t, unsigned {{long|int}} *> >"
|
||||
// CHECK:({{const char [*]|const_pointer}}) "A<B<Double32_t, unsigned {{long|int}} *> >"
|
||||
|
||||
lookup.findScope("CTD", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "C<A<B<Double32_t, int> >, Double32_t>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "C<A<B<Double32_t, int> >, Double32_t>"
|
||||
|
||||
lookup.findScope("CTDConst", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "C<A<B<const Double32_t, const int> >, Double32_t>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "C<A<B<const Double32_t, const int> >, Double32_t>"
|
||||
|
||||
lookup.findScope("std::pair<const std::string,int>", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "std::pair<const std::string, int>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "std::pair<const std::string, int>"
|
||||
|
||||
lookup.findScope("NS::Array<NS::ArrayType<double> >", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::Array<NS::ArrayType<double> >"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::Array<NS::ArrayType<double> >"
|
||||
|
||||
lookup.findScope("NS::Array<NS::ArrayType<Double32_t> >", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::Array<NS::ArrayType<Double32_t> >"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::Array<NS::ArrayType<Double32_t> >"
|
||||
|
||||
lookup.findScope("NS::Container<Long_t>::Content", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::Container<long>::Content"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::Container<long>::Content"
|
||||
|
||||
QT = lookup.findType("NS::Container<Long_t>::Value_t");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "long"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "long"
|
||||
|
||||
lookup.findScope("NS::Container<Long_t>::Content_t", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::Container<long>::Content"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::Container<long>::Content"
|
||||
|
||||
lookup.findScope("NS::Container<Long_t>::Impl_t", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "Details::Impl"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "Details::Impl"
|
||||
|
||||
lookup.findScope("NS::Container<Double32_t>::Content", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::Container<Double32_t>::Content"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::Container<Double32_t>::Content"
|
||||
|
||||
QT = lookup.findType("NS::Container<Double32_t>::Value_t");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "double"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "double"
|
||||
// Really we would want it to say Double32_t but oh well.
|
||||
|
||||
lookup.findScope("NS::Container<Double32_t>::Content_t", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::Container<Double32_t>::Content"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::Container<Double32_t>::Content"
|
||||
|
||||
lookup.findScope("NS::Container<Double32_t>::Impl_t", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "Details::Impl"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "Details::Impl"
|
||||
|
||||
lookup.findScope("NS::TDataPointF", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::TDataPoint<float>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::TDataPoint<float>"
|
||||
|
||||
lookup.findScope("NS::TDataPointD32", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::TDataPoint<Double32_t>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::TDataPoint<Double32_t>"
|
||||
|
||||
lookup.findScope("NS::ArrayType<float,1>", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::ArrayType<float, 1>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::ArrayType<float, 1>"
|
||||
|
||||
lookup.findScope("NS::FArray", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "NS::ArrayType<float, 2>"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "NS::ArrayType<float, 2>"
|
||||
|
||||
QT = lookup.findType("const NS::IntNS_t");
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "const int"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "const int"
|
||||
|
||||
lookup.findScope("vector<Details::Impl>::value_type", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "Details::Impl"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "Details::Impl"
|
||||
|
||||
lookup.findScope("vector<Details::Impl>::iterator", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "std::vector<Details::Impl>::iterator"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "std::vector<Details::Impl>::iterator"
|
||||
|
||||
lookup.findScope("vector<Details::Impl>::const_iterator", &t);
|
||||
QT = clang::QualType(t, 0);
|
||||
@ -328,7 +328,7 @@ td = QT->getAs<clang::TypedefType>();
|
||||
clang::TypedefNameDecl *tdDecl = td->getDecl();
|
||||
QT = Ctx.getTypedefType(tdDecl);
|
||||
Transform::GetPartiallyDesugaredType(Ctx, QT, transConfig, true).getAsString().c_str()
|
||||
// CHECK: ({{const char *|const_pointer}}) "std::vector<Details::Impl, std::allocator<Details::Impl> >::const_iterator"
|
||||
// CHECK: ({{const char [*]|const_pointer}}) "std::vector<Details::Impl, std::allocator<Details::Impl> >::const_iterator"
|
||||
|
||||
const clang::Decl*decl=lookup.findScope("Embedded_objects",&t);
|
||||
if (decl) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user