Debian Codegraph @

gcc/testsuite/g++.dg/spellcheck-pr79298.C

raw
1 // Ensure that we can offer suggestions for misspellings via a
2 // namespace alias.
3 // { dg-options "-fdiagnostics-show-caret" }
4
5 namespace N { int x; int color; }
6 namespace M = N;
7 namespace O = M;
8
9 int foo ()
10 {
11 return M::y; // { dg-error ".y. is not a member of .M." }
12 /* { dg-begin-multiline-output "" }
13 return M::y;
14 ^
15 { dg-end-multiline-output "" } */
16 }
17
18 int bar ()
19 {
20 return O::colour; // { dg-error ".colour. is not a member of .O.; did you mean 'color'\\?" }
21 /* { dg-begin-multiline-output "" }
22 return O::colour;
23 ^~~~~~
24 color
25 { dg-end-multiline-output "" } */
26 }