From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11883 invoked by alias); 23 Dec 2002 22: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 11864 invoked by uid 71); 23 Dec 2002 22:36:00 -0000 Resent-Date: 23 Dec 2002 22:36:00 -0000 Resent-Message-ID: <20021223223600.11862.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, jmc@xisl.com Received: (qmail 9985 invoked by uid 61); 23 Dec 2002 22:29:32 -0000 Message-Id: <20021223222932.9984.qmail@sources.redhat.com> Date: Mon, 23 Dec 2002 14:36:00 -0000 From: jmc@xisl.com Reply-To: jmc@xisl.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9048: Conditional expression error with static const members X-SW-Source: 2002-12/txt/msg01251.txt.bz2 List-Id: >Number: 9048 >Category: c++ >Synopsis: Conditional expression error with static const members >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Dec 23 14:36:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: John Collins >Release: g++-3.2 (GCC) 3.2 and all previous versions >Organization: >Environment: Mandrake Linux 9.0 3.2-1mdk >Description: class foo { int some_members; //..... public: static const int bar1 = 1, bar2 = 2; int some_other_members; // .... }; int main() { int x = 1; // This line causes a complaint about undefined // "foo::bar1" and "foo::bar2" int y = x? foo::bar1: foo::bar2; int z; // This does what I expect if (x) z = foo::bar1; else z = foo::bar2; return 0; } >How-To-Repeat: >Fix: If using static const members avoid ?: operator. >Release-Note: >Audit-Trail: >Unformatted: