This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568
- From: "ehrhardt at mathematik dot uni-ulm dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jun 2003 14:04:12 -0000
- Subject: [Bug c++/11237] New: Internal Compiler Error (segfault) in convert_from_reference at cvt.c:568
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11237
Summary: Internal Compiler Error (segfault) in
convert_from_reference at cvt.c:568
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ehrhardt@mathematik.uni-ulm.de
CC: gcc-bugs@gcc.gnu.org,stip@mathematik.uni-ulm.de
The code ICEs all versions of gcc since 2.95 and up to 3.4.
The ICE is in this piece of code in cvt.c where we have type == NULL:
tree
convert_from_reference (val)
tree val;
{
tree type = TREE_TYPE (val);
if (TREE_CODE (type) == OFFSET_TYPE)
type = TREE_TYPE (type);
if (TREE_CODE (type) == REFERENCE_TYPE)
return build_indirect_ref (val, NULL);
return val;
}
Comeau's C++ compiler accepts the code in strict C++ mode.
Here's the code:
-------------------- cut -----------------------------
template <bool V, class T>
struct restrictTo {
typedef T type;
};
template <typename T, typename U>
struct isDifferentType
{
static const bool value = true;
};
template <class D>
class ConstDenseVector { };
class MultiIndex { };
template <class C>
void operator+(ConstDenseVector<long> u, ConstDenseVector<long> v)
{ }
template <typename U, typename V>
typename restrictTo< true || isDifferentType< V, V >::value, void>::type
operator+(U u, V v)
{
operator+<long>(u, u);
}
int
main()
{
ConstDenseVector<long> v;
MultiIndex mi;
v + mi;
}
-------------------- cut -----------------------------
regards Christian