This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10079: With two identical template function signatures gcc crashes instead of emitting "ambiguous" or "duplicate"
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: <gcc-gnats at gcc dot gnu dot org>,<stip at mathematik dot uni-ulm dot de>,<gcc-bugs at gcc dot gnu dot org>,<nobody at gcc dot gnu dot org>,<gcc-prs at gcc dot gnu dot org>
- Date: Fri, 2 May 2003 20:58:00 +0200
- Subject: Re: c++/10079: With two identical template function signatures gcc crashes instead of emitting "ambiguous" or "duplicate"
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10079
Very weird. I can't compress it more than this:
----------------------------------------------------------
template <bool>
struct Foo
{};
template <typename>
struct Bar
{};
template <typename>
struct true_t
{
enum { value = true };
};
template <typename T, typename U>
Foo<(true_t<T>::value && true_t<T>::value)>
func(T t, U u)
{}
template <typename T, typename U>
void func(Bar<T>, Bar<U> )
{}
int main()
{
Bar<void> v;
func(v, v);
}
----------------------------------------------------------
pr10079.cpp: In function `int main()':
pr10079.cpp:30: internal compiler error: Segmentation fault
Please submit a full bug report,
In my wild guess, the segfault happens while trying to format the error
message about the ambiguity of the call, which requires printing the
declaration of the first func<> (that is quite complex).
Reconfirmed on everything (2.95 -> 3.4 CVS 20030430).
Giovanni Bajo