public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/1825: parse error results in Tree check: expected class 't', have 'x' (error_mark)
@ 2001-04-01 0:00 schmid
0 siblings, 0 replies; only message in thread
From: schmid @ 2001-04-01 0:00 UTC (permalink / raw)
To: gcc-gnats
>Number: 1825
>Category: c++
>Synopsis: parse error results in Tree check: expected class 't', have 'x' (error_mark)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Wed Jan 31 23:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Peter Schmid
>Release: 2.97 20010129 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.0 #25 Tue Jan 16 01:22:25 CET 2001 i686 unknown
Architecture: i686
glibc 2.1.3
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-nls --enable-shared
>Description:
The following illegal source code, a semicolon is missing after using
namespace std, generates Tree check: expected class 't', have 'x'
(error_mark).
>How-To-Repeat:
tbug3.C
typedef struct
{
int count;
int value;
} mbstate_t;
namespace std {
typedef long streamoff;
typedef long streamsize;
}
namespace std {
template<typename _StateT>
class fpos
{
public:
typedef _StateT __state_type;
private:
__state_type _M_st;
streamoff _M_off;
public:
__state_type
state() const { return _M_st; }
fpos(): _M_st(__state_type()), _M_off(streamoff()) { }
};
} // namespace std
namespace std {
typedef fpos<mbstate_t> streampos;
template<class _CharT>
struct char_traits
{
typedef streampos pos_type;
typedef mbstate_t state_type;
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
};
template<>
struct char_traits<char>
{
typedef streampos pos_type;
typedef mbstate_t state_type;
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
};
} // namespace std
using namespace std
int main (){ }
Compiling the source file tbug3.C
g++ -v -o tbug3 tbug3.C -W -Wall
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --disable-nls --enable-shared --enable-threads=posix
gcc version 2.97 20010129 (experimental)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1plus -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ tbug3.C -D__GNUG__=2 -D_GNU_SOURCE -D__GXX_ABI_VERSION=100 -quiet -dumpbase tbug3.C -W -Wall -version -o /tmp/ccqo5yzw.s
GNU CPP version 2.97 20010129 (experimental) (cpplib) (i386 Linux/ELF)
GNU CPP version 2.97 20010129 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 2.97 20010129 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 2.97 20010129 (experimental).
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++-v3
/usr/local/i686-pc-linux-gnu/include/g++-v3
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
/usr/local/i686-pc-linux-gnu/include
/usr/include
End of search list.
tbug3.C:65: parse error before `int'
tbug3.C: In member function `_StateT std::fpos<_StateT>::state() const [with
_StateT = mbstate_t]':
tbug3.C:56: instantiated from here
tbug3.C:28: `this' undeclared (first use this function)
tbug3.C:28: (Each undeclared identifier is reported only once for each function
it appears in.)
tbug3.C:28: Tree check: expected class 't', have 'x' (error_mark)
confused by earlier errors, bailing out
Preprocessor source file: tbug3.ii
# 1 "tbug3.C"
typedef struct
{
int count;
int value;
} mbstate_t;
namespace std {
typedef long streamoff;
typedef long streamsize;
}
namespace std {
template<typename _StateT>
class fpos
{
public:
typedef _StateT __state_type;
private:
__state_type _M_st;
streamoff _M_off;
public:
__state_type
state() const { return _M_st; }
fpos(): _M_st(__state_type()), _M_off(streamoff()) { }
};
}
namespace std {
typedef fpos<mbstate_t> streampos;
template<class _CharT>
struct char_traits
{
typedef streampos pos_type;
typedef mbstate_t state_type;
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
};
template<>
struct char_traits<char>
{
typedef streampos pos_type;
typedef mbstate_t state_type;
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
};
}
using namespace std
int main (){ }
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
>From rodrigc@mediaone.net Sun Apr 01 00:00:00 2001
From: Craig Rodrigues <rodrigc@mediaone.net>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org
Subject: Re: c++/1843
Date: Sun, 01 Apr 2001 00:00:00 -0000
Message-id: <20010217205603.15132.qmail@sourceware.cygnus.com>
X-SW-Source: 2001-q1/msg01374.html
Content-length: 551
The following reply was made to PR c++/1843; it has been noted by GNATS.
From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-gnats@gcc.gnu.org, xavier.oriol@delta-tek.com, nobody@gcc.gnu.org,
steven.belbin@delta-tek.com, rodrigc@mediaone.net
Cc:
Subject: Re: c++/1843
Date: Sat, 17 Feb 2001 15:53:20 -0500
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1843&database=gcc
There is no attached file associated with this report.
Can you submit a test case?
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-04-01 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-01 0:00 c++/1825: parse error results in Tree check: expected class 't', have 'x' (error_mark) schmid
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).