Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision af746ccdf606483f8f89907b52e8b9471c72df7c)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision dc58e5daa87c5b617ac609696ff96cc7f4d5a5a6)
@@ -46,5 +46,4 @@
 #include "AST/Type.hpp"
 #include "Common/utility.h"       // for move, copy
-#include "Parser/parserutility.h" // for notZeroExpr
 #include "SymTab/Mangler.h"
 #include "Tuples/Tuples.h"        // for handleTupleAssignment
@@ -1514,10 +1513,10 @@
 	void Finder::postvisit( const ast::LogicalExpr * logicalExpr ) {
 		CandidateFinder finder1( context, tenv );
-		ast::ptr<ast::Expr> arg1 = notZeroExpr( logicalExpr->arg1 );
+		ast::ptr<ast::Expr> arg1 = createCondExpr( logicalExpr->arg1 );
 		finder1.find( arg1, ResolveMode::withAdjustment() );
 		if ( finder1.candidates.empty() ) return;
 
 		CandidateFinder finder2( context, tenv );
-		ast::ptr<ast::Expr> arg2 = notZeroExpr( logicalExpr->arg2 );
+		ast::ptr<ast::Expr> arg2 = createCondExpr( logicalExpr->arg2 );
 		finder2.find( arg2, ResolveMode::withAdjustment() );
 		if ( finder2.candidates.empty() ) return;
@@ -1545,5 +1544,5 @@
 	void Finder::postvisit( const ast::ConditionalExpr * conditionalExpr ) {
 		// candidates for condition
-		ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
+		ast::ptr<ast::Expr> arg1 = createCondExpr( conditionalExpr->arg1 );
 		CandidateFinder finder1( context, tenv );
 		finder1.find( arg1, ResolveMode::withAdjustment() );
@@ -2166,5 +2165,20 @@
 		CandidateRef & choice = winners.front();
 		return choice->expr;
-		// return std::move( choice->expr.get() );
+}
+
+const ast::Expr * createCondExpr( const ast::Expr * expr ) {
+	assert( expr );
+	return new ast::CastExpr( expr->location,
+		ast::UntypedExpr::createCall( expr->location,
+			"?!=?",
+			{
+				expr,
+				new ast::ConstantExpr( expr->location,
+					new ast::ZeroType(), "0", std::make_optional( 0ull )
+				),
+			}
+		),
+		new ast::BasicType( ast::BasicType::SignedInt )
+	);
 }
 
Index: src/ResolvExpr/CandidateFinder.hpp
===================================================================
--- src/ResolvExpr/CandidateFinder.hpp	(revision af746ccdf606483f8f89907b52e8b9471c72df7c)
+++ src/ResolvExpr/CandidateFinder.hpp	(revision dc58e5daa87c5b617ac609696ff96cc7f4d5a5a6)
@@ -72,4 +72,6 @@
 const ast::Expr * getValueEnumCall(const ast::Expr * expr,
 	const ResolvExpr::ResolveContext & context, const ast::TypeEnvironment & env );
+/// Wrap an expression to convert the result to a conditional result.
+const ast::Expr * createCondExpr( const ast::Expr * expr );
 
 } // namespace ResolvExpr
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision af746ccdf606483f8f89907b52e8b9471c72df7c)
+++ src/ResolvExpr/Resolver.cc	(revision dc58e5daa87c5b617ac609696ff96cc7f4d5a5a6)
@@ -340,4 +340,12 @@
 	}
 
+	ast::ptr< ast::Expr > findCondExpression(
+		const ast::Expr * untyped, const ResolveContext & context
+	) {
+		if ( nullptr == untyped ) return untyped;
+		ast::ptr<ast::Expr> condExpr = createCondExpr( untyped );
+		return findIntegralExpression( condExpr, context );
+	}
+
 	/// check if a type is a character type
 	bool isCharType( const ast::Type * t ) {
@@ -356,5 +364,5 @@
 		return it != end;
 	}
-}
+} // anonymous namespace
 
 class Resolver final
@@ -729,10 +737,10 @@
 const ast::IfStmt * Resolver::previsit( const ast::IfStmt * ifStmt ) {
 	return ast::mutate_field(
-		ifStmt, &ast::IfStmt::cond, findIntegralExpression( ifStmt->cond, context ) );
+		ifStmt, &ast::IfStmt::cond, findCondExpression( ifStmt->cond, context ) );
 }
 
 const ast::WhileDoStmt * Resolver::previsit( const ast::WhileDoStmt * whileDoStmt ) {
 	return ast::mutate_field(
-		whileDoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, context ) );
+		whileDoStmt, &ast::WhileDoStmt::cond, findCondExpression( whileDoStmt->cond, context ) );
 }
 
@@ -740,5 +748,5 @@
 	if ( forStmt->cond ) {
 		forStmt = ast::mutate_field(
-			forStmt, &ast::ForStmt::cond, findIntegralExpression( forStmt->cond, context ) );
+			forStmt, &ast::ForStmt::cond, findCondExpression( forStmt->cond, context ) );
 	}
 
@@ -1075,5 +1083,5 @@
 
 		// Resolve the conditions as if it were an IfStmt, statements normally
-		clause2->when_cond = findSingleExpression( clause.when_cond, context );
+		clause2->when_cond = findCondExpression( clause.when_cond, context );
 		clause2->stmt = clause.stmt->accept( *visitor );
 
@@ -1089,5 +1097,5 @@
 			new ast::BasicType{ ast::BasicType::LongLongUnsignedInt };
 		auto timeout_time = findSingleExpression( stmt->timeout_time, target, context );
-		auto timeout_cond = findSingleExpression( stmt->timeout_cond, context );
+		auto timeout_cond = findCondExpression( stmt->timeout_cond, context );
 		auto timeout_stmt = stmt->timeout_stmt->accept( *visitor );
 
@@ -1102,5 +1110,5 @@
 	if ( stmt->else_stmt ) {
 		// resolve the condition like IfStmt, stmts normally
-		auto else_cond = findSingleExpression( stmt->else_cond, context );
+		auto else_cond = findCondExpression( stmt->else_cond, context );
 		auto else_stmt = stmt->else_stmt->accept( *visitor );
 
