Douglas Gregor | 83c9abc | 2010-06-22 02:41:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Douglas Gregor | 83c9abc | 2010-06-22 02:41:05 +0000 | [diff] [blame] | 3 | |
| 4 | struct mystruct { |
| 5 | int member; |
| 6 | }; |
| 7 | |
| 8 | template <int i> |
| 9 | int foo() { |
| 10 | mystruct s[1]; |
| 11 | return s->member; |
| 12 | } |
| 13 | |
| 14 | int main() { |
| 15 | foo<1>(); |
| 16 | } |
| 17 | |
| 18 | // PR7405 |
| 19 | struct hb_sanitize_context_t { |
| 20 | int start; |
| 21 | }; |
| 22 | template <typename Type> static bool sanitize() { |
| 23 | hb_sanitize_context_t c[1]; |
| 24 | return !c->start; |
| 25 | } |
| 26 | bool closure = sanitize<int>(); |