summaryrefslogtreecommitdiffstats
path: root/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp
blob: 34a178400706c592047099d31d46c40b86a4a1a5 (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
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x

template<typename T>
struct only {
  only(T);
  template<typename U> only(U) = delete;
};

void f() {
  if (auto a = true) {
  }

  switch (auto a = 0) {
  }

  while (auto a = false) {
  }

  for (; auto a = false; ) {
  }

  new const auto (0);
  new (auto) (0.0);

#if 0
  // When clang supports for-range:
  for (auto i : {1,2,3}) {
  }

  // When clang supports inline initialization of members.
  class X {
    static const auto &n = 'x';
  };
#endif
}
OpenPOWER on IntegriCloud