aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/spellcheck-pr79298.C
blob: 7016ee5af444868a62a4e83d1b026f78e02196e3 (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
// Ensure that we can offer suggestions for misspellings via a
// namespace alias.
// { dg-options "-fdiagnostics-show-caret" }

namespace N { int x; int color; }
namespace M = N; 
namespace O = M; 

int foo () 
{
  return M::y; // { dg-error ".y. is not a member of .M." }
  /* { dg-begin-multiline-output "" }
   return M::y;
             ^
     { dg-end-multiline-output "" } */
}

int bar () 
{
  return O::colour; // { dg-error ".colour. is not a member of .O.; did you mean 'color'\\?" }
  /* { dg-begin-multiline-output "" }
   return O::colour;
             ^~~~~~
             color
     { dg-end-multiline-output "" } */
}