Also print structs; add test.

This commit is contained in:
Axel Naumann 2014-08-14 14:13:40 +02:00 committed by sftnight
parent deb155f20a
commit 11d315a22b
2 changed files with 8 additions and 2 deletions

View File

@ -404,8 +404,8 @@ namespace valuePrinterInternal {
|| Ty->isArrayType())
StreamValue(o, V.getPtr(), Ty, Interp);
else {
assert(0 && "I don't know what I am printing.");
StreamValue(o, &V, Ty, Interp);
// struct case.
StreamValue(o, V.getPtr(), Ty, Interp);
}
}

View File

@ -22,6 +22,7 @@ public:
};
const A& foo(const A& arg) { return arg; }
A foo2(const A& arg) { return A(42); }
.rawInput 0
foo(A(12)).Var
@ -29,6 +30,11 @@ foo(A(12)).Var
// CHECK: A d'tor
// End PR #93006
// myvector.end() failed to print (roottest/cling/stl/default/VectorSort.C)
foo2(A(42))
// CHECK: (A) @0x{{[0-9a-f]+}}
// CHECK: A d'tor
// Savannah #96523
int *p = (int*)0x123;
p // CHECK: (int *) 0x123