C++: simplify output from suggest_alternatives_for
[official-gcc.git] / gcc / testsuite / g++.dg / spellcheck-identifiers-2.C
blob67ae52bdee4282e92b6de1879294e02b56843235
1 /* PR c/71858 */
2 /* Make sure anticipated builtins are not considered before they are declared.  */
3 /* { dg-do compile } */
4 /* { dg-options "-fdiagnostics-show-caret" } */
6 int sscafn (const char *, const char *, ...);
8 int
9 test_1 (const char *p)
11   int i;
12   return ssacnf (p, "%d", &i); /* { dg-error "10: .ssacnf. was not declared in this scope; did you mean 'sscafn'\\?" } */
13   /* { dg-begin-multiline-output "" }
14    return ssacnf (p, "%d", &i);
15           ^~~~~~
16           sscafn
17    { dg-end-multiline-output "" } */
20 int scafn (const char *, ...);
21 int scanf (const char *, ...);
23 int
24 test_2 (void)
26   int i;
27   return sacnf ("%d", &i); /* { dg-error "10: .sacnf. was not declared in this scope; did you mean 'scanf'\\?" } */
28   /* { dg-begin-multiline-output "" }
29    return sacnf ("%d", &i);
30           ^~~~~
31           scanf
32    { dg-end-multiline-output "" } */