Correct the type of logical not.

llvm-svn: 39558
This commit is contained in:
Chris Lattner 2007-06-02 19:11:33 +00:00
parent d6de65740d
commit be31ed8e88
1 changed files with 2 additions and 0 deletions

View File

@ -1229,6 +1229,8 @@ Action::ExprResult Sema::ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op,
if (!resultType->isScalarType()) // C99 6.5.3.3p1
return Diag(OpLoc, diag::err_typecheck_unary_expr,
resultType.getAsString());
// LNot always has type int. C99 6.5.3.3p5.
resultType = Context.IntTy;
break;
case UnaryOperator::SizeOf:
resultType = CheckSizeOfAlignOfOperand(((Expr *)Input)->getType(), OpLoc,