diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-02-14 13:45:42 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-02-14 13:45:42 +0000 |
commit | 4230cec2f9ee41f4a33644a0b944eaaf0430dfdc (patch) | |
tree | 6f729b6a58b61f7a435734962f2683174fe5b755 /gcc/cp/pt.c | |
parent | d1fc3bbd80a4d4dff957b9eeb5ae463f3e8f55b1 (diff) | |
download | gcc-4230cec2f9ee41f4a33644a0b944eaaf0430dfdc.zip gcc-4230cec2f9ee41f4a33644a0b944eaaf0430dfdc.tar.gz gcc-4230cec2f9ee41f4a33644a0b944eaaf0430dfdc.tar.bz2 |
re PR c++/19884 (ICE on explicit instantiation of a non-template constructor)
cp:
PR c++/19884
* pt.c (check_explicit_specialization): Make sure namespace
binding lookup found an overloaded function.
(lookup_template_function): Just assert FNS is an overloaded
function.
PR c++/19895
* decl.c (grokdeclarator): Check for error mark node in ptrmem
construction.
testsuite:
PR c++/19895
* g++.dg/parse/ptrmem3.C: New.
PR c++/19884
* g++.old-deja/g++.oliva/template6.C: Add another case.
* g++.dg/template/explicit6.C: New.
From-SVN: r95009
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b131213..7025def 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1883,6 +1883,11 @@ check_explicit_specialization (tree declarator, /* Find the namespace binding, using the declaration context. */ fns = namespace_binding (dname, CP_DECL_CONTEXT (decl)); + if (!fns || !is_overloaded_fn (fns)) + { + error ("%qD is not a template function", dname); + fns = error_mark_node; + } } declarator = lookup_template_function (fns, NULL_TREE); @@ -4196,17 +4201,8 @@ lookup_template_function (tree fns, tree arglist) return error_mark_node; gcc_assert (!arglist || TREE_CODE (arglist) == TREE_VEC); - if (fns == NULL_TREE - || TREE_CODE (fns) == FUNCTION_DECL) - { - error ("non-template used as template"); - return error_mark_node; - } - - gcc_assert (TREE_CODE (fns) == TEMPLATE_DECL - || TREE_CODE (fns) == OVERLOAD - || BASELINK_P (fns) - || TREE_CODE (fns) == IDENTIFIER_NODE); + gcc_assert (fns && (is_overloaded_fn (fns) + || TREE_CODE (fns) == IDENTIFIER_NODE)); if (BASELINK_P (fns)) { |