view gcc/testsuite/gcc.dg/diagnostic-range-bad-called-object.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-options "-fdiagnostics-show-caret" } */

/* Adapted from https://gcc.gnu.org/wiki/ClangDiagnosticsComparison */

void call_of_non_function_ptr (char **argP, char **argQ)
{
  (argP - argQ)(); /* { dg-error "called object is not a function or function pointer" } */

/* { dg-begin-multiline-output "" }
   (argP - argQ)();
   ~~~~~~^~~~~~~
   { dg-end-multiline-output "" } */

  argP();       /* { dg-error "called object 'argP' is not a function or function pointer" } */

/* { dg-begin-multiline-output "" }
   argP();
   ^~~~
   { dg-end-multiline-output "" }
   { dg-begin-multiline-output "" }
 void call_of_non_function_ptr (char **argP, char **argQ)
                                ~~~~~~~^~~~
   { dg-end-multiline-output "" } */
}