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]

[C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call


This patch avoids pretty-printing expressions when the caret is
enabled for the error given when calling as a function something that
is not a function.

This fixes (when caret is enabled) the bugs described in PR35441 and
also shown here http://clang.llvm.org/diagnostics.html (No Pretty
Printing of Expressions in Diagnostics).

Bootstrapped/regression tested.

OK?

2012-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 35441
	* c-typeck.c (inform_declaration): New.
	(build_function_call_vec):  Do not pretty-print
	expressions when caret is enabled.
	(convert_arguments): Use inform_declaration.
	* cp/typeck.c (cp_build_function_call_vec): Do not pretty-print
	expressions when caret is enabled.
	* testsuite/c-c++-common/pr35441.C: New.

Attachment: fix-pr35441-2.diff
Description: Binary data


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