Debian Codegraph @

gcc/testsuite/g++.dg/spellcheck-identifiers-2.C

raw
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" } */
5
6 int sscafn (const char *, const char *, ...);
7
8 int
9 test_1 (const char *p)
10 {
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 "" } */
18 }
19
20 int scafn (const char *, ...);
21 int scanf (const char *, ...);
22
23 int
24 test_2 (void)
25 {
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 "" } */
33 }