Commit 5cce22b6 by Nathan Sidwell Committed by Nathan Sidwell

cp-tree.h (PARMLIST_ELLIPSIS_P): New macro.

cp:
	* cp-tree.h (PARMLIST_ELLIPSIS_P): New macro.
	* decl.c (grokdeclarator): Don't reject void parms here.
	(require_complete_types_for_parms): Simplify, use
	complete_type_or_else.
	(grokparms): Remove bitrot. Remove funcdef parm.
	Deal with ellipsis parm lists here.
	* semantics.c (finish_parmlist): Don't append void_list_node
	here. Set PARMLIST_ELLIPSIS_P.

testsuite:
	* g++.old-deja/g++.other/incomplete.C: Add more tests.
	* g++.old-deja/g++.pt/crash9.C: Mark new expected error.

From-SVN: r37517
parent 146c8d60
2000-11-17 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (PARMLIST_ELLIPSIS_P): New macro.
* decl.c (grokdeclarator): Don't reject void parms here.
(require_complete_types_for_parms): Simplify, use
complete_type_or_else.
(grokparms): Remove bitrot. Remove funcdef parm.
Deal with ellipsis parm lists here.
* semantics.c (finish_parmlist): Don't append void_list_node
here. Set PARMLIST_ELLIPSIS_P.
2000-11-17 Nathan Sidwell <nathan@codesourcery.com>
* typeck2.c (incomplete_type_error): Reorganise to avoid
excessive diagnostics.
......
......@@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */
CTOR_BEGIN_P (in CTOR_STMT)
BV_USE_VCALL_INDEX_P (in the BINFO_VIRTUALS TREE_LIST)
PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF)
PARMLIST_ELLIPSIS_P (in PARMLIST)
1: IDENTIFIER_VIRTUAL_P.
TI_PENDING_TEMPLATE_FLAG.
TEMPLATE_PARMS_FOR_INLINE.
......@@ -1768,6 +1769,9 @@ struct lang_type
is a list of parameters, as opposed to a list of expressions. */
#define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
/* Nonzero for a parmlist means that this parmlist ended in ... */
#define PARMLIST_ELLIPSIS_P(NODE) TREE_LANG_FLAG_0 (NODE)
/* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
will be NULL_TREE to indicate a throw specification of `()', or
......
......@@ -1695,13 +1695,15 @@ finish_parmlist (parms, ellipsis)
tree parms;
int ellipsis;
{
if (!ellipsis)
chainon (parms, void_list_node);
/* We mark the PARMS as a parmlist so that declarator processing can
disambiguate certain constructs. */
if (parms != NULL_TREE)
TREE_PARMLIST (parms) = 1;
if (parms)
{
/* We mark the PARMS as a parmlist so that declarator processing can
disambiguate certain constructs. */
TREE_PARMLIST (parms) = 1;
/* We do not append void_list_node here, but leave it to grokparms
to do that. */
PARMLIST_ELLIPSIS_P (parms) = ellipsis;
}
return parms;
}
......
2000-11-17 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/incomplete.C: Add more tests.
* g++.old-deja/g++.pt/crash9.C: Mark new expected error.
2000-11-16 Nick Clifton <nickc@redhat.com>
* gcc.c-torture/execute/nestfunc-2.c: New test.
......
// Build don't link:
struct S;
// gcc represents non-ellipsis parmlists by terminating them with
// a void parm. We need to distinguish between a parmlist of (void), and
// some ill-formed ones.
void f(S s) {} // ERROR - incomplete type
struct S; // ERROR - forward ref
void f(S); // ok
void f(S s) {} // ERROR - incomplete type
void j (int){}; // ok
void k (){}; // ok
void q (void){} // ok
void t (void t); // ERROR - incomplete
void r (void, ...); // ERROR - incomplete
void s (void const); // ERROR - incomplete
......@@ -3,7 +3,7 @@
template <class T>
void f(T) {} // ERROR - parameter has incomplete type
class C;
class C; // ERROR - forward declaration
void g(const C& c)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment