public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Carlini <pcarlini@suse.de>
To: Gabriel Dos Reis <gdr@cs.tamu.edu>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [C++, diagnostic] PR 33494
Date: Thu, 01 Nov 2007 02:13:00 -0000	[thread overview]
Message-ID: <47293631.3060201@suse.de> (raw)
In-Reply-To: <87pryun35j.fsf@soliton.cs.tamu.edu>

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Hi Gaby,
> sorry for the delay.
>   
No problem.
> I was meaning to actually call pp_expression(), which indirectly calls
> pp_cxx_expression. 
>   
Ah, now I see...
> This part is OK, if you s/pp_cxx_expression/pp_expression/ and it
> passes regression tests.
>   
Excellent, the below is what I actually committed. Tested x86_64-linux.

Thanks,
Paolo.

/////////////////

[-- Attachment #2: CL_33494_3 --]
[-- Type: text/plain, Size: 559 bytes --]

/cp
2007-10-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33494
	* cxx-pretty-print.c (pp_cxx_typeid_expression,
	pp_cxx_delete_expression): Change to static linkage.
	* cxx-pretty-print.h: Adjust declarations.
	* error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
	MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
	MODOP_EXPR): Forward to pp_expression.

	* cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
	Fix typo.

/testsuite
2007-10-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33494
	* g++.dg/template/error35.C: New.

[-- Attachment #3: patch_33494_3 --]
[-- Type: text/plain, Size: 5022 bytes --]

Index: testsuite/g++.dg/template/error35.C
===================================================================
*** testsuite/g++.dg/template/error35.C	(revision 0)
--- testsuite/g++.dg/template/error35.C	(revision 0)
***************
*** 0 ****
--- 1,3 ----
+ // PR c++/33494
+ 
+ template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|erroneous-expression" }
Index: cp/error.c
===================================================================
*** cp/error.c	(revision 129768)
--- cp/error.c	(working copy)
*************** dump_expr (tree t, int flags)
*** 1873,1882 ****
        dump_decl (TEMPLATE_PARM_DECL (t), flags & ~TFF_DECL_SPECIFIERS);
        break;
  
-     case SCOPE_REF:
-       pp_expression (cxx_pp, t);
-       break;
- 
      case CAST_EXPR:
        if (TREE_OPERAND (t, 0) == NULL_TREE
  	  || TREE_CHAIN (TREE_OPERAND (t, 0)))
--- 1873,1878 ----
*************** dump_expr (tree t, int flags)
*** 2004,2014 ****
        dump_expr (TREE_OPERAND (t, 0), flags);
        break;
  
-     case EXPR_PACK_EXPANSION:
-       dump_expr (PACK_EXPANSION_PATTERN (t), flags);
-       pp_cxx_identifier (cxx_pp, "...");
-       break;
- 
      case ARGUMENT_PACK_SELECT:
        dump_template_argument (ARGUMENT_PACK_SELECT_FROM_PACK (t), flags);
        break;
--- 2000,2005 ----
*************** dump_expr (tree t, int flags)
*** 2040,2049 ****
        pp_cxx_trait_expression (cxx_pp, t);
        break;
  
-     case TYPEID_EXPR:
-       pp_cxx_typeid_expression (cxx_pp, t);
-       break;
- 
      case VA_ARG_EXPR:
        pp_cxx_va_arg_expression (cxx_pp, t);
        break;
--- 2031,2036 ----
*************** dump_expr (tree t, int flags)
*** 2052,2065 ****
        pp_cxx_offsetof_expression (cxx_pp, t);
        break;
  
      case MEMBER_REF:
      case DOTSTAR_EXPR:
-       pp_multiplicative_expression (cxx_pp, t);
-       break;
- 
      case DELETE_EXPR:
      case VEC_DELETE_EXPR:
!       pp_cxx_delete_expression (cxx_pp, t);
        break;
  
        /*  This list is incomplete, but should suffice for now.
--- 2039,2053 ----
        pp_cxx_offsetof_expression (cxx_pp, t);
        break;
  
+     case SCOPE_REF:
+     case EXPR_PACK_EXPANSION:
+     case TYPEID_EXPR:
      case MEMBER_REF:
      case DOTSTAR_EXPR:
      case DELETE_EXPR:
      case VEC_DELETE_EXPR:
!     case MODOP_EXPR:
!       pp_expression (cxx_pp, t);
        break;
  
        /*  This list is incomplete, but should suffice for now.
Index: cp/cxx-pretty-print.c
===================================================================
*** cp/cxx-pretty-print.c	(revision 129768)
--- cp/cxx-pretty-print.c	(working copy)
*************** static void pp_cxx_abstract_declarator (
*** 43,48 ****
--- 43,49 ----
  static void pp_cxx_statement (cxx_pretty_printer *, tree);
  static void pp_cxx_template_parameter (cxx_pretty_printer *, tree);
  static void pp_cxx_cast_expression (cxx_pretty_printer *, tree);
+ static void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
  \f
  
  static inline void
*************** pp_cxx_new_expression (cxx_pretty_printe
*** 672,678 ****
        ::(opt) delete cast-expression
        ::(opt) delete [ ] cast-expression   */
  
! void
  pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
  {
    enum tree_code code = TREE_CODE (t);
--- 673,679 ----
        ::(opt) delete cast-expression
        ::(opt) delete [ ] cast-expression   */
  
! static void
  pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
  {
    enum tree_code code = TREE_CODE (t);
*************** pp_cxx_expression (cxx_pretty_printer *p
*** 1064,1070 ****
  
      case NON_DEPENDENT_EXPR:
      case MUST_NOT_THROW_EXPR:
!       pp_cxx_expression (pp, t);
        break;
  
      case EXPR_PACK_EXPANSION:
--- 1065,1071 ----
  
      case NON_DEPENDENT_EXPR:
      case MUST_NOT_THROW_EXPR:
!       pp_cxx_expression (pp, TREE_OPERAND (t, 0));
        break;
  
      case EXPR_PACK_EXPANSION:
*************** pp_cxx_declaration (cxx_pretty_printer *
*** 2161,2167 ****
      }
  }
  
! void
  pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t)
  {
    t = TREE_OPERAND (t, 0);
--- 2162,2168 ----
      }
  }
  
! static void
  pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t)
  {
    t = TREE_OPERAND (t, 0);
Index: cp/cxx-pretty-print.h
===================================================================
*** cp/cxx-pretty-print.h	(revision 129768)
--- cp/cxx-pretty-print.h	(working copy)
*************** void pp_cxx_separate_with (cxx_pretty_pr
*** 70,78 ****
  void pp_cxx_declaration (cxx_pretty_printer *, tree);
  void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
  void pp_cxx_trait_expression (cxx_pretty_printer *, tree);
- void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
  void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree);
  void pp_cxx_offsetof_expression (cxx_pretty_printer *, tree);
- void pp_cxx_delete_expression (cxx_pretty_printer *, tree);
  
  #endif /* GCC_CXX_PRETTY_PRINT_H */
--- 70,76 ----

  parent reply	other threads:[~2007-11-01  2:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 12:17 Paolo Carlini
2007-10-29 13:21 ` Gabriel Dos Reis
2007-10-29 14:25   ` Paolo Carlini
2007-11-01  1:41     ` Gabriel Dos Reis
2007-11-01  2:00       ` Gabriel Dos Reis
2007-11-01  2:04         ` Paolo Carlini
2007-11-01  2:04           ` Gabriel Dos Reis
2007-11-01  2:13       ` Paolo Carlini [this message]
2007-11-01  2:14         ` Gabriel Dos Reis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47293631.3060201@suse.de \
    --to=pcarlini@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdr@cs.tamu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).