From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32586 invoked by alias); 16 Dec 2001 18:36:01 -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 32555 invoked by uid 71); 16 Dec 2001 18:36:01 -0000 Resent-Date: 16 Dec 2001 18:36:01 -0000 Resent-Message-ID: <20011216183601.32554.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, wwcopt@optonline.net Received:(qmail 31462 invoked from network); 16 Dec 2001 18:31:12 -0000 Received: from unknown (HELO mail.optonline.net) (24.185.91.22) by sources.redhat.com with SMTP; 16 Dec 2001 18:31:12 -0000 Received: (from wwc@localhost) by mail.optonline.net (8.9.1/8.9.1) id NAA00652; Sun, 16 Dec 2001 13:31:04 -0500 Message-Id:<200112161831.NAA00652@mail.optonline.net> Date: Sun, 16 Dec 2001 10:36:00 -0000 From: wwcopt@optonline.net Reply-To: wwcopt@optonline.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c++/5132: NaN = 0.0 * HUGE_VAL fails to compile in templates X-SW-Source: 2001-12/txt/msg00917.txt.bz2 List-Id: >Number: 5132 >Category: c++ >Synopsis: NaN = 0.0 * HUGE_VAL fails to compile in templates >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Sun Dec 16 10:36:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: wolfgang wander >Release: 3.1 20011216 (experimental) >Organization: none >Environment: System: Linux groby 2.4.17-pre5 #39 Sat Dec 8 15:36:51 EST 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc/configure --enable-long-long --enable-languages=c++,c --prefix=/work/gcc >Description: Generating a NaN from 0.0*HUGE_VAL fails with a tree check error if the expression is inside template code (function or class). >How-To-Repeat: Compile the following code with g++ -c bugnan.C ------------------------- bugnan.C ---------------------- // snippets from bits/huge_val.h #define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } #define __huge_val_t union { unsigned char __c[8]; double __d; } #define HUGE_VAL (__extension__ \ ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) void foo( const int&) { const double nan = 0.0 * HUGE_VAL; // no problem here } template void Tfoo( const F&) { const double nan = 0.0 * HUGE_VAL; // g++ fails here } -------------------------- >Fix: Only workaround is to avoid templates ... >Release-Note: >Audit-Trail: >Unformatted: