summaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/array-to-pointer-decay.cpp
blob: 072c0e52edc6d073acecf0803b415b60da829cb6 (about) (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
// RUN: %clang_cc1 -fsyntax-only -verify %s

struct mystruct {
  int  member;
};

template <int i>
int foo() {
  mystruct s[1];
  return s->member;
}

int main() {
  foo<1>();
}

// PR7405
struct hb_sanitize_context_t {
  int start;
};
template <typename Type> static bool sanitize() {
  hb_sanitize_context_t c[1];
  return !c->start;
}
bool closure = sanitize<int>();