2010-06-22 10:41:05 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2010-06-22 10:41:05 +08:00
|
|
|
|
|
|
|
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>();
|
2013-06-06 08:19:36 +08:00
|
|
|
|
|
|
|
// PR16206
|
|
|
|
typedef struct {
|
|
|
|
char x[4];
|
|
|
|
} chars;
|
|
|
|
|
|
|
|
chars getChars();
|
|
|
|
void use(char *);
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
use(getChars().x);
|
|
|
|
}
|