diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-03 00:34:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-03 00:34:39 +0000 |
commit | 1931b44da8da86979a8d7ceb48685686503f197b (patch) | |
tree | dba897c62d24d63d0f881f34ac6a8e045e3451da /test/Sema/struct-decl.c | |
parent | 45012a7ef5abf1042c893f3f2fa5c23cb5485ea9 (diff) |
Simplify the way in which we inject the names of tag definitions and
elaborated-type-specifier declarations into outer scopes while
retaining their proper lexical scope. This way is simpler and more
consistent with the way DeclContexts work, and also fixes
http://llvm.org/bugs/show_bug.cgi?id=3430
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/struct-decl.c')
-rw-r--r-- | test/Sema/struct-decl.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c index 7d7961b16c..ec006b484f 100644 --- a/test/Sema/struct-decl.c +++ b/test/Sema/struct-decl.c @@ -1,5 +1,4 @@ // RUN: clang -fsyntax-only -verify %s - // PR3459 struct bar { char n[1]; @@ -9,3 +8,17 @@ struct foo { char name[(int)&((struct bar *)0)->n]; char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{fields must have a constant size}} }; + +// PR3430 +struct s { + struct st { + int v; + } *ts; +}; + +struct st; + +int foo() { + struct st *f; + return f->v + f[0].v; +} |