From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1560 invoked by alias); 31 Dec 2002 12:16:02 -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 1536 invoked by uid 71); 31 Dec 2002 12:16:01 -0000 Resent-Date: 31 Dec 2002 12:16:01 -0000 Resent-Message-ID: <20021231121601.1534.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, andrew@andypo.net Received: (qmail 30955 invoked by uid 61); 31 Dec 2002 12:08:58 -0000 Message-Id: <20021231120858.30954.qmail@sources.redhat.com> Date: Tue, 31 Dec 2002 04:16:00 -0000 From: andrew@andypo.net Reply-To: andrew@andypo.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9112: [gcc-3.4] new C++ parser rejects code older parsers accepted X-SW-Source: 2002-12/txt/msg01461.txt.bz2 List-Id: >Number: 9112 >Category: c++ >Synopsis: [gcc-3.4] new C++ parser rejects code older parsers accepted >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Tue Dec 31 04:16:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Andrew Pollard >Release: gcc-3.4-20021230 (experimental) >Organization: >Environment: gcc-3.4-20021230 (experimental) >Description: As confirmed on the gcc mailing list, the following code should compile [ http://gcc.gnu.org/ml/gcc/2002-12/msg01615.html ] a.cxx: ------------------------- struct A { int a, b; A(int i, int j) : a(i), b(j) {} void foo() {}; }; int main() { int a = 2; A(a, a).foo(); return (0); } -------------------------- % g++34 a.cxx a.cxx: In function `int main()': a.cxx:11: error: conflicting types for `A a' a.cxx:10: error: previous declaration as `int a' a.cxx:11: error: expected init-declarator a.cxx:11: error: expected `,' or `;' It appears to think that I want to declare a new variable 'a' with type 'A', whereas I want to construct a temporary A(2,2) and invoke foo() on it. Previous versions of g++ work (3.0-cvs, 3.2-cvs, 3.3-cvs) and so do icc-70 and VC++6.0 >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: