This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9172: SEGV in make_typename_type
- From: ritzert at t-online dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 4 Jan 2003 16:27:49 -0000
- Subject: c++/9172: SEGV in make_typename_type
- Reply-to: ritzert at t-online dot de
>Number: 9172
>Category: c++
>Synopsis: SEGV in make_typename_type
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sat Jan 04 08:36:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Michael Ritzert
>Release: gcc version 3.4 20030103
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The corrected testcase of c++/9098 now really crashes the compiler...
template <class baz>
struct bar
{
typedef typename baz::typename rebind<int> foo;
};
gives
Program received signal SIGSEGV, Segmentation fault.
0x08069068 in make_typename_type (context=0x0, name=0x401ba8c0,
complain=tf_error) at /opt/gcc3/gcc/gcc/cp/decl.c:5648
5648 if (TREE_CODE (context) == NAMESPACE_DECL)
(gdb) bt
#0 0x08069068 in make_typename_type (context=0x0, name=0x401ba8c0,
complain=tf_error) at /opt/gcc3/gcc/gcc/cp/decl.c:5648
#1 0x080ef53b in cp_parser_type_specifier (parser=0x401ba6c0, flags=3,
is_friend=false, is_declaration=true, declares_class_or_enum=0xbfffefca,
is_cv_qualifier=0xbfffefcb) at /opt/gcc3/gcc/gcc/cp/parser.c:8670
#2 0x080edb6d in cp_parser_decl_specifier_seq (parser=0x401ba6c0,
flags=3221221323, attributes=0xbffff010, declares_class_or_enum=0xbffff017)
at /opt/gcc3/gcc/gcc/cp/parser.c:6975
#3 0x080f2e80 in cp_parser_member_declaration (parser=0x401ba6c0)
at /opt/gcc3/gcc/gcc/cp/parser.c:12150
I don't know if this is a regression or not - 2.95.3 and 3.2.2 do not accept the code, either (parse error before `typename').
>How-To-Repeat:
cat << EOF > x.cpp
template <class baz>
struct bar
{
typedef typename baz::typename rebind<int> foo;
};
EOF
gcc -c x.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: