re PR c++/12184 (ICE with trying to convert an incomplete type)
cp: PR c++/12184 * typeck.c (convert_arguments): Return error_mark_node for an incomplete parameter. Make error message more informative. testsuite: PR c++/12184 * g++.dg/expr/call2.C: New test. From-SVN: r71402
This commit is contained in:
parent
2352184a1f
commit
3afd2e2007
5 changed files with 39 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-09-15 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/12184
|
||||
* typeck.c (convert_arguments): Return error_mark_node for an
|
||||
incomplete parameter. Make error message more informative.
|
||||
|
||||
2003-09-12 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/3907
|
||||
|
|
14
gcc/cp/pt.c
14
gcc/cp/pt.c
|
@ -5254,12 +5254,14 @@ instantiate_class_template (tree type)
|
|||
if (TYPE_LANG_SPECIFIC (tag) && CLASSTYPE_IS_TEMPLATE (tag))
|
||||
/* Unfortunately, lookup_template_class sets
|
||||
CLASSTYPE_IMPLICIT_INSTANTIATION for a partial
|
||||
instantiation (i.e., for the type of a member template
|
||||
class nested within a template class.) This behavior is
|
||||
required for maybe_process_partial_specialization to work
|
||||
correctly, but is not accurate in this case; the TAG is not
|
||||
an instantiation of anything. (The corresponding
|
||||
TEMPLATE_DECL is an instantiation, but the TYPE is not.) */
|
||||
instantiation (i.e., for the type of a member
|
||||
template class nested within a template class.)
|
||||
This behavior is required for
|
||||
maybe_process_partial_specialization to work
|
||||
correctly, but is not accurate in this case;
|
||||
the TAG is not an instantiation of anything.
|
||||
(The corresponding TEMPLATE_DECL is an
|
||||
instantiation, but the TYPE is not.) */
|
||||
CLASSTYPE_USE_TEMPLATE (newtag) = 0;
|
||||
|
||||
/* Now, we call pushtag to put this NEWTAG into the scope of
|
||||
|
|
|
@ -2532,8 +2532,12 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
|
|||
|
||||
if (!COMPLETE_TYPE_P (complete_type (type)))
|
||||
{
|
||||
error ("parameter type of called function is incomplete");
|
||||
parmval = val;
|
||||
if (fndecl)
|
||||
error ("parameter %P of `%D' has incomplete type `%T'",
|
||||
i, fndecl, type);
|
||||
else
|
||||
error ("parameter %P has incomplete type `%T'", i, type);
|
||||
parmval = error_mark_node;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2003-09-15 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/12184
|
||||
* g++.dg/expr/call2.C: New test.
|
||||
|
||||
2003-09-15 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* gcc.dg/Wold-style-definition-1.c: New test.
|
||||
|
|
14
gcc/testsuite/g++.dg/expr/call2.C
Normal file
14
gcc/testsuite/g++.dg/expr/call2.C
Normal file
|
@ -0,0 +1,14 @@
|
|||
// { dg-do compile }
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Contributed by Nathan Sidwell 11 Sep 2003 <nathan@codesourcery.com>
|
||||
// Origin: Wolfgang Bangerth <bangerth@dealii.org>
|
||||
// PR c++/12184. ICE
|
||||
|
||||
class C;
|
||||
class D;
|
||||
bool mm(D);
|
||||
|
||||
void g(C& f) {
|
||||
mm(f); // { dg-error "parameter" "" }
|
||||
}
|
Loading…
Add table
Reference in a new issue