summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/cpp11-migrate/UseAuto/new_cv_failing.cpp
blob: 8e21018ef90bfdf8bb49857b600556b8037a9bd9 (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
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
// RUN: cpp11-migrate -use-auto %t.cpp -- -std=c++11
// RUN: FileCheck -input-file=%t.cpp %s
// XFAIL: *

// None of these tests can pass right now because TypeLoc information where CV
// qualifiers are concerned is not reliable/available.

class MyType {
};

int main (int argc, char **argv) {
  const MyType *d = new MyType();
  // CHECK: const auto *d = new MyType();

  volatile MyType *d2 = new MyType();
  // CHECK: volatile auto *d2 = new MyType();

  const MyType * volatile e = new MyType();
  // CHECK: const auto * volatile d = new MyType();

  volatile MyType * const f = new MyType();
  // CHECK: volatile auto * const d2 = new MyType();

  const MyType *d5 = new const MyType();
  // CHECK: auto d5 = new const MyType();

  volatile MyType *d6 = new volatile MyType();
  // CHECK: auto d6 = new volatile MyType();

  const MyType * const d7 = new const MyType();
  // CHECK: const auto d7 = new const MyType();

  volatile MyType * volatile d8 = new volatile MyType();
  // CHECK: volatile auto d8 = new volatile MyType();
}
OpenPOWER on IntegriCloud