Commit d4d2a98f by Ian Lance Taylor

Don't crash using value of something with no value.

From-SVN: r168982
parent 8386b63d
......@@ -482,6 +482,15 @@ bool
Type::are_assignable(const Type* lhs, const Type* rhs, std::string* reason)
{
// Do some checks first. Make sure the types are defined.
if (rhs != NULL
&& rhs->forwarded()->forward_declaration_type() == NULL
&& rhs->is_void_type())
{
if (reason != NULL)
*reason = "non-value used as value";
return false;
}
if (lhs != NULL && lhs->forwarded()->forward_declaration_type() == NULL)
{
// Any value may be assigned to the blank identifier.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment