summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/dependent-auto.cpp
blob: 0ea59481d5f3e54a249e6d9fe0f5c97b5aa51995 (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
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x

template<typename T>
struct only {
  only(T);
  template<typename U> only(U) = delete; // expected-note {{here}}
};

template<typename ...T>
void f(T ...t) {
  auto x(t...); // expected-error {{requires an initializer}} expected-error {{contains multiple expressions}}
  only<int> check = x;
}

void g() {
  f(); // expected-note {{here}}
  f(0);
  f(0, 1); // expected-note {{here}}
}


template<typename T>
bool h(T t) {
  auto a = t;
  decltype(a) b;
  a = a + b;

  auto p = new auto(t);

  only<double*> test = p; // expected-error {{conversion function from 'char *' to 'only<double *>'}}
  return p;
}

bool b = h('x'); // expected-note {{here}}
OpenPOWER on IntegriCloud