]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR c/24293 (Undefined behaviour not diagnosed with -fsyntax-only)
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Wed, 20 Jan 2016 16:25:23 +0000 (16:25 +0000)
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>
Wed, 20 Jan 2016 16:25:23 +0000 (16:25 +0000)
commitd25c7690621ad26fe03b0c38040ded1e8667372c
tree8f34e243e6c141a45fea0369c0d2d05d4e2954cf
parentb235cdd5f50456368772692ce5ec139e2e09b360
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
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wcxx-compat-8.c
gcc/testsuite/gcc.dg/declspec-1.c
gcc/testsuite/gcc.dg/pr24293.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr63549.c