This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32232] [4.1 Regression] ICE in resolve_overloaded_unification
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2007 23:04:33 -0000
- Subject: [Bug c++/32232] [4.1 Regression] ICE in resolve_overloaded_unification
- References: <bug-32232-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from reichelt at gcc dot gnu dot org 2007-07-11 23:04 -------
Mark, I don't think the fix for this PR is complete, because the following
simplified testcase (which previously ICE'd) should compile IMHO:
=============================================================
template<typename> struct A
{
A& operator<<(void (*)(A&));
};
template<typename T> A<T>& operator<<(A<T>&, const A<T>&);
template<typename T> void foo(A<T>&);
void bar()
{
A<int>() << (1, foo<int>);
}
=============================================================
But it is rejected with the following error message:
bug.cc: In function 'void bar()':
bug.cc:12: error: no match for 'operator<<' in 'A<int>() << (0, foo<int>)'
bug.cc:3: note: candidates are: A< <template-parameter-1-1> >& A<
<template-parameter-1-1> >::operator<<(void (*)(A< <template-parameter-1-1>
>&)) [with <template-parameter-1-1> = int]
An even smaller testcase for this problem is the following:
=============================================================
struct A
{
A& operator<<(void (*)(A&));
};
template<typename> void foo(A&);
void bar()
{
A() << (1, foo<int>);
}
=============================================================
bug.cc: In function 'void bar()':
bug.cc:10: error: no match for 'operator<<' in 'A() << (0, foo<int>)'
bug.cc:3: note: candidates are: A& A::operator<<(void (*)(A&))
The code compiles fine, if I remove the "0,".
Btw, there's another glitch in the error message:
The code contains "(1, foo<int>)", which is printed as "(0, foo<int>)"
in the error message.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32232