From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24468 invoked by alias); 2 Jul 2002 19:36:14 -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 24397 invoked by uid 71); 2 Jul 2002 19:36:10 -0000 Resent-Date: 2 Jul 2002 19:36:10 -0000 Resent-Message-ID: <20020702193610.24385.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, wls@wwco.com Received: (qmail 20733 invoked from network); 2 Jul 2002 19:33:01 -0000 Received: from unknown (HELO spiff.wwco.com) (207.196.42.236) by sources.redhat.com with SMTP; 2 Jul 2002 19:33:01 -0000 Received: (from wls@localhost) by spiff.wwco.com (8.11.5/8.11.5) id g62JX2w15518; Tue, 2 Jul 2002 15:33:02 -0400 Message-Id: <200207021933.g62JX2w15518@spiff.wwco.com> Date: Tue, 02 Jul 2002 12:36:00 -0000 From: wls@wwco.com Reply-To: wls@wwco.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: libstdc++/7187: virtual keyword parser error in STL templates X-SW-Source: 2002-07/txt/msg00071.txt.bz2 List-Id: >Number: 7187 >Category: libstdc++ >Synopsis: Parse error concerning virtual keyword in the STL template >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Tue Jul 02 12:36:05 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Walt Stoneburner >Release: 3.1 >Organization: self >Environment: Slackware 8.0 System: Linux spiff 2.4.17 #2 Wed Jan 16 17:37:02 EST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../configure >Description: Including and using the STL used to work in 3.0.x. GCC v3.1 now produces an error message, even if the file is included and never called. In file included from /usr/local/include/g++-v3/fstream:48, from t.cc:1: /usr/local/include/g++-v3/bits/basic_file.h:52: parse error before `{' token /usr/local/include/g++-v3/bits/basic_file.h:57: virtual outside class declaration ...technically, the STL has this inside of a struct, but even if you change the STL to read class, it does not work. >How-To-Repeat: 1. Make a C++ file with just the include header. No code will call it. wls@spiff:/tmp$ cat /tmp/t.cc #include wls@spiff:/tmp$ g++ -v Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs Configured with: ../configure Thread model: single gcc version 3.1 2. Compile the file ... which should fail at the link stage. We don't get that far. wls@spiff:/tmp$ g++ /tmp/t.cc In file included from /usr/local/include/g++-v3/fstream:48, from /tmp/t.cc:1: /usr/local/include/g++-v3/bits/basic_file.h:52: parse error before `{' token /usr/local/include/g++-v3/bits/basic_file.h:57: virtual outside class declaration /usr/local/include/g++-v3/bits/basic_file.h:57: function `int std::overflow(int = -1)' is initialized like a variable hen reporting a compiler error, preprocessor output must be included> >Fix: Not using causes the error to go away in my projects, however, I'm then left without a file streaming mechanism. >Release-Note: >Audit-Trail: >Unformatted: