minix/external/bsd/llvm/dist/clang/test/SemaTemplate/array-to-pointer-decay.cpp
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

38 lines
521 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
// expected-no-diagnostics
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>();
// PR16206
typedef struct {
char x[4];
} chars;
chars getChars();
void use(char *);
void test() {
use(getChars().x);
}