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 | 8761da5f68c6d35434458f52ffe255a9bb5d0c4e (patch) | |
tree | d8202cdfe9a2b3866af5d504659e8eed753cdff9 /clang/test/Sema/struct-decl.c | |
parent | 423f3bc196a79c0c5ba3c5fa543924194e00cd81 (diff) | |
download | bcm5719-llvm-8761da5f68c6d35434458f52ffe255a9bb5d0c4e.tar.gz bcm5719-llvm-8761da5f68c6d35434458f52ffe255a9bb5d0c4e.zip |
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
llvm-svn: 63581
Diffstat (limited to 'clang/test/Sema/struct-decl.c')
-rw-r--r-- | clang/test/Sema/struct-decl.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/Sema/struct-decl.c b/clang/test/Sema/struct-decl.c index 7d7961b16c8..ec006b484f0 100644 --- a/clang/test/Sema/struct-decl.c +++ b/clang/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; +} |