public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/7187: virtual keyword parser error in STL templates
@ 2002-07-02 12:36 wls
0 siblings, 0 replies; only message in thread
From: wls @ 2002-07-02 12:36 UTC (permalink / raw)
To: gcc-gnats
>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 <fstream> 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 <fstream>
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 <fstream> causes the error to go away in my projects,
however, I'm then left without a file streaming mechanism.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-02 19:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-02 12:36 libstdc++/7187: virtual keyword parser error in STL templates wls
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).