mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-30 16:15:35 +08:00
method.c (hack_identifier): Complain about getting a namespace or class template.
* method.c (hack_identifier): Complain about getting a namespace or class template. * typeck.c (decay_conversion): Remove check for namespaces. * typeck2.c (incomplete_type_error): Likewise. * parse.y (template_arg): Add PTYPENAME expansion. From-SVN: r20532
This commit is contained in:
parent
e4d4bdf2a9
commit
0e607f3473
@ -1,3 +1,11 @@
|
||||
1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* method.c (hack_identifier): Complain about getting a namespace
|
||||
or class template.
|
||||
* typeck.c (decay_conversion): Remove check for namespaces.
|
||||
* typeck2.c (incomplete_type_error): Likewise.
|
||||
* parse.y (template_arg): Add PTYPENAME expansion.
|
||||
|
||||
1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
|
||||
|
||||
* decl.c (grokvardecl): Don't build external assembler names for
|
||||
|
@ -1845,8 +1845,15 @@ hack_identifier (value, name)
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (value) == NAMESPACE_DECL)
|
||||
/* A namespace is not really expected here; this is likely illegal code. */
|
||||
return value;
|
||||
{
|
||||
cp_error ("use of namespace `%D' as expression", value);
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (DECL_CLASS_TEMPLATE_P (value))
|
||||
{
|
||||
cp_error ("use of class template `%T' as expression", value);
|
||||
return error_mark_node;
|
||||
}
|
||||
else
|
||||
mark_used (value);
|
||||
|
||||
|
7330
gcc/cp/parse.c
7330
gcc/cp/parse.c
File diff suppressed because it is too large
Load Diff
@ -885,6 +885,8 @@ template_arg_list:
|
||||
template_arg:
|
||||
type_id
|
||||
{ $$ = groktypename ($1.t); }
|
||||
| PTYPENAME
|
||||
{ $$ = lastiddecl; }
|
||||
| expr_no_commas %prec ARITHCOMPARE
|
||||
;
|
||||
|
||||
|
@ -1620,12 +1620,6 @@ decay_conversion (exp)
|
||||
type = TREE_TYPE (exp);
|
||||
}
|
||||
|
||||
if (TREE_CODE (exp) == NAMESPACE_DECL)
|
||||
{
|
||||
cp_error ("namespace `%D' used as expression", exp);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
|
||||
Leave such NOP_EXPRs, since RHS is being used in non-lvalue context. */
|
||||
|
||||
|
@ -274,8 +274,6 @@ incomplete_type_error (value, type)
|
||||
if (value != 0 && (TREE_CODE (value) == VAR_DECL
|
||||
|| TREE_CODE (value) == PARM_DECL))
|
||||
cp_error ("`%D' has incomplete type", value);
|
||||
else if (value && TREE_CODE (value) == NAMESPACE_DECL)
|
||||
cp_error ("namespace `%D' used as expression", value);
|
||||
else
|
||||
{
|
||||
retry:
|
||||
|
Loading…
Reference in New Issue
Block a user