diff options
Diffstat (limited to 'clang/test/SemaTemplate/array-to-pointer-decay.cpp')
-rw-r--r-- | clang/test/SemaTemplate/array-to-pointer-decay.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/array-to-pointer-decay.cpp b/clang/test/SemaTemplate/array-to-pointer-decay.cpp new file mode 100644 index 0000000..072c0e5 --- /dev/null +++ b/clang/test/SemaTemplate/array-to-pointer-decay.cpp @@ -0,0 +1,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>(); |