diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-06-22 02:41:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-06-22 02:41:05 +0000 |
commit | 83c9abcce26422420dcdb9d2741bced21ee2477f (patch) | |
tree | 5bd4bd63524161db7e0ec565a3309026c731df10 /test/SemaTemplate/array-to-pointer-decay.cpp | |
parent | cd9fb98c9911b40497f791954b40275322fd6741 (diff) |
Apply array-to-pointer decay when instantiating a MemberExpr. Fixes
PR7405, patch by Kyle Lippincott!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/array-to-pointer-decay.cpp')
-rw-r--r-- | test/SemaTemplate/array-to-pointer-decay.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaTemplate/array-to-pointer-decay.cpp b/test/SemaTemplate/array-to-pointer-decay.cpp new file mode 100644 index 0000000000..072c0e52ed --- /dev/null +++ b/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>(); |