[Bug c++/104792] Wunused-local-typedefs with typedef/type alias defined in struct that is defined in a function scope

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 6 01:39:57 GMT 2022


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-reduction             |
            Summary|[g++ and/or libstdc++]      |Wunused-local-typedefs with
                   |Wunused-local-typedefs +    |typedef/type alias defined
                   |C++20 concepts = annoying   |in struct that is defined
                   |                            |in a function scope

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
void test() {
    struct It {
        using value_type = int;
        using difference_type = int;
    };
    It *t = 0;
}

The warning for the two type alias (typedef) does not make sense here really.
If the struct It was not defined in the function scope, GCC (and clang) does
not warn.


More information about the Gcc-bugs mailing list