pt.c (determine_specialization): Ignore functions without DECL_TEMPLATE_INFO.
* pt.c (determine_specialization): Ignore functions without DECL_TEMPLATE_INFO. From-SVN: r46243
This commit is contained in:
parent
45701819ce
commit
f5d47abdf7
@ -1,3 +1,8 @@
|
||||
2001-10-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
* pt.c (determine_specialization): Ignore functions without
|
||||
DECL_TEMPLATE_INFO.
|
||||
|
||||
2001-10-12 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR g++/4476
|
||||
|
@ -1040,6 +1040,12 @@ determine_specialization (template_id, decl, targs_out,
|
||||
Here, S<int>::f is a non-template, but S<int> is a
|
||||
template class. If FN has the same type as DECL, we
|
||||
might be in business. */
|
||||
|
||||
if (!DECL_TEMPLATE_INFO (fn))
|
||||
/* Its enclosing class is an explicit specialization
|
||||
of a template class. This is not a candidate. */
|
||||
continue;
|
||||
|
||||
if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),
|
||||
TREE_TYPE (TREE_TYPE (fn))))
|
||||
/* The return types differ. */
|
||||
|
21
gcc/testsuite/g++.dg/template/spec1.C
Normal file
21
gcc/testsuite/g++.dg/template/spec1.C
Normal file
@ -0,0 +1,21 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// Origin: <schmid@snake.iap.physik.tu-darmstadt.de>
|
||||
|
||||
// Bug: ICE during invalid instantiation of member function
|
||||
// which enclosing class is specialized.
|
||||
|
||||
template <class T>
|
||||
struct A
|
||||
{
|
||||
void f(T) {}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct A<int>
|
||||
{
|
||||
void f(int) {}
|
||||
};
|
||||
|
||||
template
|
||||
void A<int>::f(int); // { dg-error "not match" }
|
22
gcc/testsuite/g++.dg/template/spec2.C
Normal file
22
gcc/testsuite/g++.dg/template/spec2.C
Normal file
@ -0,0 +1,22 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// Origin: <schmid@snake.iap.physik.tu-darmstadt.de>
|
||||
|
||||
// Bug: Overloading of ordinary and template member function
|
||||
// which enclosing class is specialized is not handled correctly.
|
||||
|
||||
template <class T>
|
||||
struct A
|
||||
{
|
||||
void f(T) {}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct A<int>
|
||||
{
|
||||
void f(int) {}
|
||||
template <class T> void f(T) {}
|
||||
};
|
||||
|
||||
template
|
||||
void A<int>::f(int);
|
Loading…
Reference in New Issue
Block a user