diff options
author | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2016-01-20 16:25:23 +0000 |
---|---|---|
committer | Prathamesh Kulkarni <prathamesh3492@gcc.gnu.org> | 2016-01-20 16:25:23 +0000 |
commit | d25c7690621ad26fe03b0c38040ded1e8667372c (patch) | |
tree | 8f34e243e6c141a45fea0369c0d2d05d4e2954cf /gcc/c/c-tree.h | |
parent | b235cdd5f50456368772692ce5ec139e2e09b360 (diff) | |
download | gcc-d25c7690621ad26fe03b0c38040ded1e8667372c.zip gcc-d25c7690621ad26fe03b0c38040ded1e8667372c.tar.gz gcc-d25c7690621ad26fe03b0c38040ded1e8667372c.tar.bz2 |
re PR c/24293 (Undefined behaviour not diagnosed with -fsyntax-only)
2016-01-15 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR c/24293
* c-tree.h (incomplete_record_decls): Declare.
* c-parser.c (incomplete_record_decls): Define.
(c_parser_translation_unit): Iterate through incomplete_record_decls and
report error if any decl has zero size.
* c-decl.c (finish_decl): Append static decl with incomplete struct/union
or enum type to incomplete_record_decls.
testsuite/
* gcc.dg/pr24293.c: New test.
* gcc.dg/Wcxx-compat-8.c: Adjust to accept error due to
incomplete struct type.
* gcc.dg/declspec-1.c: Likewise.
* gcc.dg/pr63549.c: Likewise.
From-SVN: r232622
Diffstat (limited to 'gcc/c/c-tree.h')
-rw-r--r-- | gcc/c/c-tree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index 81a3d58..cf79ba7 100644 --- a/gcc/c/c-tree.h +++ b/gcc/c/c-tree.h @@ -731,4 +731,6 @@ set_c_expr_source_range (c_expr *expr, /* In c-fold.c */ extern tree decl_constant_value_for_optimization (tree); +extern vec<tree> incomplete_record_decls; + #endif /* ! GCC_C_TREE_H */ |