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]

[Bug c++/12146] ICE in lookup_template_function at cp/pt.c:4005


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12146



------- Additional Comments From gbeauchesne at mandrakesoft dot com  2003-09-03 07:30 -------
Subject: Re:  ICE in lookup_template_function at cp/pt.c:4005

On Wed, 2 Sep 2003, wjl at icecavern dot net wrote:

> Created an attachment (id=4689)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4689&action=view)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4689&action=view)
> This is the preprocessed source that makes it ICE.

Here is a simplified testcase:

// { dg-do compile }

// PR c++/12146: Incorrect template specialization of non-template function.

struct A { };
struct B { };

A f(const B & b) {
	return A();
}

template<>
B f(const A & a) { // { dg-error "not match" }
	return B();
}


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