public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30721] New: ICE on invalid template code
@ 2007-02-06 21:33 v dot haisman at sh dot cvut dot cz
2007-02-06 21:36 ` [Bug c++/30721] " v dot haisman at sh dot cvut dot cz
2007-02-09 0:35 ` reichelt at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2007-02-06 21:33 UTC (permalink / raw)
To: gcc-bugs
Attached test case ICEs. The code is AFAIK invalid:
-------8<-------
#include <stdio.h>
template <typename Numeric>
class Table
{
typedef struct
{
const char * const name;
Numeric index;
} Tableitem;
static const Tableitem entries[];
public:
const char * const
operator[] (Numeric Tableindex)
{
for (int i=0; i<sizeof(entries)/sizeof(Tableitem); ++i)
if(entries[i].index==Tableindex)
return entries[i].name;
return 0;
}
};
enum funky { feeling, lost, somewhere, in, space };
template<funky>
const Table<funky>::Tableitem Table<funky>::entries[] =
{
{"feeling", feeling},
{"lost", lost},
{"somewhere", somewhere},
{"in", in},
{"space", space},
};
int main (int argc, char **argv)
{
Table<funky> FunkyTable;
printf("Funkytable somewhere=[%s]\n", FunkyTable[somewhere]);
return 0;
}
-------8<-------
The error:
logout::wilx:~/tmp> g++42 -o ice ice.cxx
ice.cxx:14: internal compiler error: in import_export_decl, at cp/decl2.c:1956
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
GCC version:
logout::wilx:~/tmp> g++42 -v
Using built-in specs.
Target: i386-portbld-freebsd6.2
Configured with: ./..//gcc-4.2-20070117/configure --disable-nls
--with-system-zlib --with-libiconv-prefix=/usr/local --with-gmp=/usr/local
--program-suffix=42 --libdir=/usr/local/lib/gcc-4.2.0
--with-gxx-include-dir=/usr/local/lib/gcc-4.2.0/include/c++/
--infodir=/usr/local/info/gcc42 --disable-rpath --prefix=/usr/local
i386-portbld-freebsd6.2
Thread model: posix
gcc version 4.2.0 20070117 (prerelease)
--
Summary: ICE on invalid template code
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: v dot haisman at sh dot cvut dot cz
GCC build triplet: i386-portbld-freebsd6.2
GCC host triplet: i386-portbld-freebsd6.2
GCC target triplet: i386-portbld-freebsd6.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30721
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/30721] ICE on invalid template code
2007-02-06 21:33 [Bug c++/30721] New: ICE on invalid template code v dot haisman at sh dot cvut dot cz
@ 2007-02-06 21:36 ` v dot haisman at sh dot cvut dot cz
2007-02-09 0:35 ` reichelt at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2007-02-06 21:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from v dot haisman at sh dot cvut dot cz 2007-02-06 21:36 -------
(In reply to comment #0)
>[...]
> logout::wilx:~/tmp> g++42 -o ice ice.cxx
> ice.cxx:14: internal compiler error: in import_export_decl, at cp/decl2.c:1956
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
>[...]
I submitted wrong error message, this is the right one:
logout::wilx:~/tmp> g++42 -o goezzi goezzi.cxx
goezzi.cxx: In member function 'const char* const
Table<Numeric>::operator[](Numeric) [with Numeric = funky]':
goezzi.cxx:19: instantiated from 'const Table<funky>::Tableitem
Table<funky>::entries [5]'
goezzi.cxx:19: instantiated from 'const char* const
Table<Numeric>::operator[](Numeric) [with Numeric = funky]'
goezzi.cxx:41: instantiated from here
goezzi.cxx:19: internal compiler error: in instantiate_decl, at cp/pt.c:12090
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30721
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/30721] ICE on invalid template code
2007-02-06 21:33 [Bug c++/30721] New: ICE on invalid template code v dot haisman at sh dot cvut dot cz
2007-02-06 21:36 ` [Bug c++/30721] " v dot haisman at sh dot cvut dot cz
@ 2007-02-09 0:35 ` reichelt at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-02-09 0:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from reichelt at gcc dot gnu dot org 2007-02-09 00:34 -------
See first testcase in comment #1 of PR24791.
*** This bug has been marked as a duplicate of 24791 ***
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30721
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-02-09 0:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-06 21:33 [Bug c++/30721] New: ICE on invalid template code v dot haisman at sh dot cvut dot cz
2007-02-06 21:36 ` [Bug c++/30721] " v dot haisman at sh dot cvut dot cz
2007-02-09 0:35 ` reichelt at gcc dot gnu dot org
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).