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  <m...@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

Reply via email to