aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/spellcheck-identifiers-2.C
blob: 67ae52bdee4282e92b6de1879294e02b56843235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* PR c/71858 */
/* Make sure anticipated builtins are not considered before they are declared.  */
/* { dg-do compile } */
/* { dg-options "-fdiagnostics-show-caret" } */

int sscafn (const char *, const char *, ...);

int
test_1 (const char *p)
{
  int i;
  return ssacnf (p, "%d", &i); /* { dg-error "10: .ssacnf. was not declared in this scope; did you mean 'sscafn'\\?" } */
  /* { dg-begin-multiline-output "" }
   return ssacnf (p, "%d", &i);
          ^~~~~~
          sscafn
   { dg-end-multiline-output "" } */
}

int scafn (const char *, ...);
int scanf (const char *, ...);

int
test_2 (void)
{
  int i;
  return sacnf ("%d", &i); /* { dg-error "10: .sacnf. was not declared in this scope; did you mean 'scanf'\\?" } */
  /* { dg-begin-multiline-output "" }
   return sacnf ("%d", &i);
          ^~~~~
          scanf
   { dg-end-multiline-output "" } */
}