(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
diagnostic-range-bad-called-object.c
       1  /* { dg-options "-fdiagnostics-show-caret" } */
       2  
       3  /* Adapted from https://gcc.gnu.org/wiki/ClangDiagnosticsComparison */
       4  
       5  void call_of_non_function_ptr (char **argP, char **argQ)
       6  {
       7    (argP - argQ)(); /* { dg-error "called object is not a function or function pointer" } */
       8  
       9  /* { dg-begin-multiline-output "" }
      10     (argP - argQ)();
      11     ~~~~~~^~~~~~~
      12     { dg-end-multiline-output "" } */
      13  
      14    argP();       /* { dg-error "called object 'argP' is not a function or function pointer" } */
      15  
      16  /* { dg-begin-multiline-output "" }
      17     argP();
      18     ^~~~
      19     { dg-end-multiline-output "" }
      20     { dg-begin-multiline-output "" }
      21   void call_of_non_function_ptr (char **argP, char **argQ)
      22                                  ~~~~~~~^~~~
      23     { dg-end-multiline-output "" } */
      24  }