summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/spellcheck-fields-2.C
blob: eb10b44e59e05fdda2ee3cb55d885f396e3424c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-options "-fdiagnostics-show-caret" }

union u
{
  int color;
  int shape;
};

int test (union u *ptr)
{
  return ptr->colour; // { dg-error "did you mean .color.?" }
}

// Verify that we get an underline and a fixit hint.
/* { dg-begin-multiline-output "" }
   return ptr->colour;
               ^~~~~~
               color
   { dg-end-multiline-output "" } */