diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-29 05:12:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-29 05:12:23 +0000 |
commit | 0f94c5a741cf27e869905e98653e08f308d17043 (patch) | |
tree | 150789143d26cb85e10b434050cb54b80acf4c84 /clang/test/Sema/struct-decl.c | |
parent | 0b50fb1de13ca200a5beddc55c249b5e777112cc (diff) | |
download | bcm5719-llvm-0f94c5a741cf27e869905e98653e08f308d17043.tar.gz bcm5719-llvm-0f94c5a741cf27e869905e98653e08f308d17043.zip |
Fix PR4092 by improving error recovery in two ways:
1. In a struct field redefinition, don't mark the struct erroneous. The
field is erroneous, but the struct is otherwise well formed.
2. Don't emit diagnostics about functions that are known to be broken already.
Either fix is sufficient to silence the second diagnostic in the example,
but the combination is better :)
llvm-svn: 70371
Diffstat (limited to 'clang/test/Sema/struct-decl.c')
-rw-r--r-- | clang/test/Sema/struct-decl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Sema/struct-decl.c b/clang/test/Sema/struct-decl.c index b288850a731..2c0945f9f86 100644 --- a/clang/test/Sema/struct-decl.c +++ b/clang/test/Sema/struct-decl.c @@ -33,3 +33,11 @@ struct datatag { char data; }; + +// PR4092 +struct s0 { + char a; // expected-note {{previous declaration is here}} + char a; // expected-error {{duplicate member 'a'}} +}; + +struct s0 f0(void) {} |