From be31ed8e88c83dcbc19e86890cc02bc7f852a1b3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 2 Jun 2007 19:11:33 +0000 Subject: [PATCH] Correct the type of logical not. llvm-svn: 39558 --- clang/Sema/SemaExpr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp index 6d373968eb38..2c40ad3281ae 100644 --- a/clang/Sema/SemaExpr.cpp +++ b/clang/Sema/SemaExpr.cpp @@ -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,