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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:d392babbeb6cb531ab8b1ec68fde9ffd36373a6e

commit r11-1459-gd392babbeb6cb531ab8b1ec68fde9ffd36373a6e
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Jun 17 20:26:13 2020 +0100

    c++: Fix bogus "does not declare anything" warning (PR 66159)

    G++ gives a bogus warning for 'struct A; using B = struct ::A;'
    complaining that the elaborated-type-specifier doesn't declare anything.
    That's true, but it's not trying to declare struct ::A, just refer to it
    unambiguously. Do not emit the warning unless we're actually parsing a
    declaration.

    gcc/cp/ChangeLog:

            PR c++/66159
            * parser.c (cp_parser_elaborated_type_specifier): Do not warn
            unless in a declaration.

    gcc/testsuite/ChangeLog:

            PR c++/66159
            * g++.dg/warn/forward-inner.C: Check alias-declaration using
            elaborated-type-specifier.

Reply via email to