public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5761: ICE #19990331 in grokdeclarator, using templates
@ 2002-02-23 13:06 jcab
0 siblings, 0 replies; only message in thread
From: jcab @ 2002-02-23 13:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 5761
>Category: c++
>Synopsis: ICE #19990331 in grokdeclarator, using templates
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sat Feb 23 12:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Juan Carlos Arevalo-Baeza
>Release: 3.0.3
>Organization:
>Environment:
CygWin
>Description:
The tiny program below ICEs the compiler. The culprit seems to be the "template" keyword in line 24, where it says "typedef super_t::template iterator<".
>How-To-Repeat:
Compile the following program:
---
template < typename GrammarT >
struct grammar_filter {
template < typename IteratorT >
struct iterator
{
typedef typename GrammarT::result_type value_type;
};
};
struct cpp_lexer_phase_1: grammar_filter<cpp_lexer_phase_1> {
typedef char result_type;
};
template < typename Phase1 >
struct cpp_lexer_phase_2: grammar_filter<cpp_lexer_phase_2<Phase1> > {
typedef cpp_lexer_phase_2<Phase1> this_t;
typedef grammar_filter<cpp_lexer_phase_2<Phase1> > super_t;
typedef char const* result_type;
struct iterator: super_t::iterator<
typename Phase1::iterator<char const*>
> {
typedef super_t::template iterator<
typename Phase1::iterator<char const*>
> super_iterator;
};
};
cpp_lexer_phase_2<cpp_lexer_phase_1>::iterator::super_iterator* kk =
reinterpret_cast<
cpp_lexer_phase_2<cpp_lexer_phase_1>::super_t::iterator<
cpp_lexer_phase_1::iterator<char const*>
>*
>
(0);
---
I get:
---
$ g++ bug3.cpp -O2 -ftemplate-depth-50 -g
bug3.cpp:27: Internal error #19990331.
bug3.cpp:27: Internal compiler error in grokdeclarator, at cp/decl.c:9767
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
---
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-02-23 20:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-23 13:06 c++/5761: ICE #19990331 in grokdeclarator, using templates jcab
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).