This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]