summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/spellcheck-pr78656.C
blob: ded4bb6be852d742cfd152ffbe9c65ce28c8772e (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
34
35
36
37
38
39
// { dg-options "-fdiagnostics-show-caret" }

#include <memory>

void* allocate(std::size_t n)
{
  return std::allocate<char>().allocate(n); // { dg-error ".allocate. is not a member of .std." }
  // { dg-message "suggested alternative: .allocator." "" { target *-*-* } .-1 }
  /* { dg-begin-multiline-output "" }
   return std::allocate<char>().allocate(n);
               ^~~~~~~~
     { dg-end-multiline-output "" } */ 
  /* { dg-begin-multiline-output "" }
   return std::allocate<char>().allocate(n);
               ^~~~~~~~
               allocator
     { dg-end-multiline-output "" } */

  // Various errors follow that we don't care about; suppress them:
  // { dg-excess-errors "7: " }
}

void* test_2(std::size_t n)
{
  return std::alocator<char>().allocate(n); // { dg-error ".alocator. is not a member of .std." }
  // { dg-message "suggested alternative: .allocator." "" { target *-*-* } .-1 }
  /* { dg-begin-multiline-output "" }
   return std::alocator<char>().allocate(n);
               ^~~~~~~~
     { dg-end-multiline-output "" } */ 
  /* { dg-begin-multiline-output "" }
   return std::alocator<char>().allocate(n);
               ^~~~~~~~
               allocator
     { dg-end-multiline-output "" } */

  // Various errors follow that we don't care about; suppress them:
  // { dg-excess-errors "25: " }
}