This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 33462


Gabriel Dos Reis wrote:

| The error message is incorrect.  Most users will not use
| __builtin_va_arg directly, they will be using va_arg.  So when they
| see __builtin_va_arg, it will confuse them.  Can you please change it
| to be va_arg instead of __builtin_va_arg.

Agreed.


Ok, I'm committing the tweak.

Paolo.

//////////////
2007-09-18  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33462 (again)
	* cp/cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
	va_arg instead of __builtin_va_arg.
	* g++.dg/ext/va-arg1.C: Adjust.
Index: testsuite/g++.dg/ext/va-arg1.C
===================================================================
*** testsuite/g++.dg/ext/va-arg1.C	(revision 128584)
--- testsuite/g++.dg/ext/va-arg1.C	(working copy)
*************** struct A {};
*** 4,8 ****
  
  void foo()
  {
!   ++__builtin_va_arg(0, A); // { dg-error "'\\+\\+__builtin_va_arg\\(0, A\\)'" }
  }
--- 4,8 ----
  
  void foo()
  {
!   ++__builtin_va_arg(0, A); // { dg-error "'\\+\\+va_arg\\(0, A\\)'" }
  }
Index: cp/cxx-pretty-print.c
===================================================================
*** cp/cxx-pretty-print.c	(revision 128584)
--- cp/cxx-pretty-print.c	(working copy)
*************** pp_cxx_typeid_expression (cxx_pretty_pri
*** 2161,2167 ****
  void
  pp_cxx_va_arg_expression (cxx_pretty_printer *pp, tree t)
  {
!   pp_cxx_identifier (pp, "__builtin_va_arg");
    pp_cxx_left_paren (pp);
    pp_cxx_assignment_expression (pp, TREE_OPERAND (t, 0));
    pp_cxx_separate_with (pp, ',');
--- 2161,2167 ----
  void
  pp_cxx_va_arg_expression (cxx_pretty_printer *pp, tree t)
  {
!   pp_cxx_identifier (pp, "va_arg");
    pp_cxx_left_paren (pp);
    pp_cxx_assignment_expression (pp, TREE_OPERAND (t, 0));
    pp_cxx_separate_with (pp, ',');

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]