Debian Codegraph @

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

raw
1 // { dg-options "-fdiagnostics-show-caret" }
2
3 #include <memory>
4
5 void* allocate(std::size_t n)
6 {
7 return std::allocate<char>().allocate(n); // { dg-error ".allocate. is not a member of .std.; did you mean 'allocator'\\?" }
8 /* { dg-begin-multiline-output "" }
9 return std::allocate<char>().allocate(n);
10 ^~~~~~~~
11 allocator
12 { dg-end-multiline-output "" } */
13
14 // Various errors follow that we don't care about; suppress them:
15 // { dg-excess-errors "7: " }
16 }
17
18 void* test_2(std::size_t n)
19 {
20 return std::alocator<char>().allocate(n); // { dg-error ".alocator. is not a member of .std.; did you mean 'allocator'\\?" }
21 /* { dg-begin-multiline-output "" }
22 return std::alocator<char>().allocate(n);
23 ^~~~~~~~
24 allocator
25 { dg-end-multiline-output "" } */
26
27 // Various errors follow that we don't care about; suppress them:
28 // { dg-excess-errors "25: " }
29 }