2003-10-08  Giovanni Bajo  <giovannibajo@libero.it>

	* cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS.
	* error.c (dump_function_decl): Use it to skip the dump of the
	arguments.
	(dump_expr): When dumping a declaration found within an
	expression, always set TFF_NO_FUNCTION_ARGUMENTS
	in the flags.


2003-10-08  Giovanni Bajo  <giovannibajo@libero.it>

	* g++.dg/parse/error7.C: New test.


diff -c -w -p -r1.847 cp-tree.h
*** gcc/cp/cp-tree.h   18 May 2003 13:40:52 -0000      1.847
--- gcc/cp/cp-tree.h   24 Jun 2003 01:11:52 -0000
*************** enum overload_flags { NO_SPECIAL = 0, DT
*** 3428,3434 ****
     TFF_TEMPLATE_HEADER: show the template<...> header in a
         template-declaration.
     TFF_TEMPLATE_NAME: show only template-name.
!    TFF_EXPR_IN_PARENS: Parenthesize expressions.  */

  #define TFF_PLAIN_IDENTIFIER               (0)
  #define TFF_SCOPE                        (1)
--- 3428,3435 ----
     TFF_TEMPLATE_HEADER: show the template<...> header in a
         template-declaration.
     TFF_TEMPLATE_NAME: show only template-name.
!    TFF_EXPR_IN_PARENS: parenthesize expressions.
!    TFF_NO_FUNCTION_ARGUMENTS: don't show function arguments.  */

  #define TFF_PLAIN_IDENTIFIER               (0)
  #define TFF_SCOPE                        (1)
*************** enum overload_flags { NO_SPECIAL = 0, DT
*** 3441,3446 ****
--- 3442,3448 ----
  #define TFF_TEMPLATE_HEADER                (1 << 7)
  #define TFF_TEMPLATE_NAME                  (1 << 8)
  #define TFF_EXPR_IN_PARENS                 (1 << 9)
+ #define TFF_NO_FUNCTION_ARGUMENTS          (1 << 10)

  /* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM
     node.  */
diff -c -w -p -r1.208 error.c
*** gcc/cp/error.c     21 May 2003 01:39:38 -0000      1.208
--- gcc/cp/error.c     24 Jun 2003 01:09:36 -0000
*************** dump_function_decl (tree t, int flags)
*** 1128,1134 ****

    dump_function_name (t, flags);

!   if (1)
      {
        dump_parameters (parmtypes, flags);

--- 1128,1134 ----

    dump_function_name (t, flags);

!   if (!(flags & TFF_NO_FUNCTION_ARGUMENTS))
      {
        dump_parameters (parmtypes, flags);

*************** dump_expr (tree t, int flags)
*** 1411,1417 ****
      case NAMESPACE_DECL:
      case OVERLOAD:
      case IDENTIFIER_NODE:
!       dump_decl (t, flags & ~TFF_DECL_SPECIFIERS);
        break;

      case INTEGER_CST:
--- 1411,1417 ----
      case NAMESPACE_DECL:
      case OVERLOAD:
      case IDENTIFIER_NODE:
!       dump_decl (t, (flags & ~TFF_DECL_SPECIFIERS) | TFF_NO_FUNCTION_ARGUMENTS);
        break;

      case INTEGER_CST:

// { dg-do compile }
// Properly print CALL_EXPRs while dumping expressions

double g;
int func(double);

template <int>
struct Foo {};

Foo<func(g)> f; // { dg-error "" "func(g)" }


