From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8998 invoked by alias); 12 Dec 2002 15:56:04 -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 8973 invoked by uid 71); 12 Dec 2002 15:56:03 -0000 Resent-Date: 12 Dec 2002 15:56:03 -0000 Resent-Message-ID: <20021212155603.8972.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, tkarkanis@aw.sgi.com Received: (qmail 2800 invoked by uid 61); 12 Dec 2002 15:48:33 -0000 Message-Id: <20021212154833.2799.qmail@sources.redhat.com> Date: Thu, 12 Dec 2002 07:56:00 -0000 From: tkarkanis@aw.sgi.com Reply-To: tkarkanis@aw.sgi.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8914: parentheses not accepted around constructor call in return statement X-SW-Source: 2002-12/txt/msg00711.txt.bz2 List-Id: >Number: 8914 >Category: c++ >Synopsis: parentheses not accepted around constructor call in return statement >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Dec 12 07:56:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: tkarkanis@aw.sgi.com >Release: 3.2 >Organization: >Environment: Red Hat Linux >Description: If a return statement has parentheses around the expression, and the expression returns a temporary object created by calling the constructor without arguments, g++ emits a parse error. See attached file. This problem seems to exist in many versions of gcc. A workaround is to remove the parentheses enclosing the return expression. >How-To-Repeat: g++ -c return.cpp >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="return.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="return.cpp" Y2xhc3MgRm9vCnsKcHVibGljOgogICAgRm9vKCk7CiAgICBGb28oIGludCApOwp9OwoKRm9vIGYo KQp7CiAgICAvLyByZXR1cm4gRm9vKCk7ICAgICAgIC8vIHdvcmtzCiAgICAvLyByZXR1cm4oIEZv bygwKSApOyAgIC8vIHdvcmtzCiAgICByZXR1cm4oIEZvbygpICk7ICAgICAgIC8vIGZhaWxzCn0K