[Bug c++/105061] [9/10 Regression] [c++2a+] anonymous bitfield templated offset rejected

wjwray at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Mar 26 11:00:33 GMT 2022


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

--- Comment #1 from Will Wray <wjwray at gmail dot com> ---
Hmm, the accepted simplified version ^^^ with typename parameter removed
is then rejected if 'unsigned' is replaced with 'uint32_t' from <cstdint>

    #include <cstdint>
    template <int width, int offset>
    struct uint_offset_bitfield { uint32_t : offset, field : width; };
    |                                      ^
    | error: found ':' in nested-name-specifier, expected '::'
    |                                      ::
    | error: invalid use of '::'

(and "error: invalid use of '::'" is just wrong - no use of '::' at all)


More information about the Gcc-bugs mailing list