Void has no address.

This commit is contained in:
Axel Naumann 2014-05-26 17:30:45 +02:00 committed by sftnight
parent 6e9cd68cb2
commit 39ed28c03e
2 changed files with 4 additions and 5 deletions

View File

@ -216,9 +216,8 @@ static void StreamClingValue(llvm::raw_ostream& o, const Value* value) {
o << value->simplisticCastAs<unsigned long long>();
} else if (valType->isBooleanType())
o << (value->simplisticCastAs<bool>() ? "true" : "false");
else {
else if (!valType->isVoidType())
StreamValue(o, value->getPtr(), valType, value->getASTContext());
}
o << "]";
}
}

View File

@ -18,16 +18,16 @@ gCling->evaluate("return 1;", V);
V // CHECK: (cling::Value &) boxes [(int) 1]
gCling->evaluate("(void)V", V);
V // CHECK-NEXT: (cling::Value &) boxes [(void) @0x{{.*}}]
V // CHECK-NEXT: (cling::Value &) boxes [(void) ]
// Returns must put the result in the Value.
bool cond = true;
gCling->evaluate("if (cond) return \"true\"; else return 0;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(const char [5]) "true"]
gCling->evaluate("if (cond) return; else return 12;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(void) @0x{{.*}}]
V // CHECK-NEXT: (cling::Value &) boxes [(void) ]
gCling->evaluate("if (cond) return; int aa = 12;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(void) @0x{{.*}}]
V // CHECK-NEXT: (cling::Value &) boxes [(void) ]
gCling->evaluate("cond = false; if (cond) return \"true\"; else return 0;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(int) 0]