https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77404

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>:

https://gcc.gnu.org/g:3fe07cdec8c79bce53ea5aeb8e607df6eb5c8c2c

commit r11-4969-g3fe07cdec8c79bce53ea5aeb8e607df6eb5c8c2c
Author: Iain Sandoe <i...@sandoe.co.uk>
Date:   Sun Oct 25 07:49:16 2020 +0000

    C-family, Objective-C [1/3] : Implement Wobjc-root-class [PR77404].

    This warning catches the case that the user has left the
    superclass specification from a class interface.  Root
    classes are, of course, permitted and an attribute is added
    to mark these so that the diagnostic is suppressed.

    The warning and attribute spellings have been kept in sync
    with the language reference implementation (clang).

    The diagnostic location information present in the objective-c
    interface and class definitions is relatively poor.  This patch
    adds a location for the class name to the interface and makes use
    of it in existing warnings.

    Part 1 is the changes to code and added tests.

    Many entries in the testsuite make use of root classes so
    there are a large number of mechanical changes there adding
    "-Wno-objc-root-class" to the options.

    The test changes are parts 2 (objective-c) and 3 (objective-c++)
    in the patch series.

    gcc/c-family/ChangeLog:

            PR objc/77404
            * c-attribs.c (handle_objc_root_class_attribute): New
            * c-objc.h (objc_start_class_interface): Add a location
            value for the position of the class name.
            * c.opt: Add Wobjc-root-class.
            * stub-objc.c (objc_start_class_interface): Add a location
            value for the position of the class name.

    gcc/c/ChangeLog:

            PR objc/77404
            * c-parser.c (c_parser_objc_class_definition): Pass the
            location of the class name to the interface declaration.

    gcc/cp/ChangeLog:

            PR objc/77404
            * parser.c (cp_parser_objc_class_interface): Pass the
            location of the class name to the interface declaration.

    gcc/objc/ChangeLog:

            PR objc/77404
            * objc-act.c (objc_start_class_interface): Accept the location
            of the class name, use it in existing diagnostic.
            (start_class): Accept obj_root_class type attributes.  Warn when
            the interface for an implementation does not contain a super
            class (unless the diagnostic is suppressed by the the command
            line flag or the objc_root_class type attribute).

    gcc/testsuite/ChangeLog:

            PR objc/77404
            * objc.dg/attributes/root-class-01.m: New test.
            * objc.dg/root-class-00.m: New test.
            * obj-c++.dg/attributes/root-class-01.mm: New test.
            * obj-c++.dg/root-class-00.mm: New test.

    gcc/ChangeLog:

            PR objc/77404
            * doc/extend.texi: Document the objc_root_class attribute.
            * doc/invoke.texi: Document -Wobjc-root-class.

Reply via email to