From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3217 invoked by alias); 12 Mar 2003 10:26:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3190 invoked by uid 71); 12 Mar 2003 10:26:01 -0000 Resent-Date: 12 Mar 2003 10:26:01 -0000 Resent-Message-ID: <20030312102601.3189.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, roland.illig@gmx.de Received: (qmail 2725 invoked by uid 48); 12 Mar 2003 10:21:21 -0000 Message-Id: <20030312102121.2724.qmail@sources.redhat.com> Date: Wed, 12 Mar 2003 10:26:00 -0000 From: roland.illig@gmx.de Reply-To: roland.illig@gmx.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/10036: new keyword "boolif" that accepts only bool values "true" or "false" as arguments; comparison operators that return bool values. X-SW-Source: 2003-03/txt/msg00669.txt.bz2 List-Id: >Number: 10036 >Category: c >Synopsis: new keyword "boolif" that accepts only bool values "true" or "false" as arguments; comparison operators that return bool values. >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Wed Mar 12 10:26:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: roland.illig@gmx.de >Release: unknown-1.0 >Organization: >Environment: any >Description: #include /* let === be an equality operator whose type is (any,any)->bool. */ int main(void) { int a = 12345; int b = -12345; boolif (a - b === 0) { printf("ok\n"); } else { printf("not ok\n"); } boolif (a) { /* this shall lead to a compiler error */ printf("12345 == true\n"); } else { printf("12345 != true\n"); } } The strict-bool type shall have no implicit conversion rules from or to other types. The only way to get a strict-bool is the application of the strict-bool operators. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: