[Bug c++/123618] [reflection] annotation on void parameter accepted

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 16 22:14:08 GMT 2026


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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:8dc559d513563164733025b462ee4668441ffcf6

commit r16-8120-g8dc559d513563164733025b462ee4668441ffcf6
Author: Marek Polacek <polacek@redhat.com>
Date:   Mon Mar 16 10:33:51 2026 -0400

    c++/reflection: reject annotations on void parms [PR123618]

    Annotations on void parameter don't make much sense so they
    should be rejected, even if the wording isn't currently so
    clear on that.

            PR c++/123618

    gcc/cp/ChangeLog:

            * tree.cc (handle_annotation_attribute): Reject annotations on void
            parameters.

    gcc/testsuite/ChangeLog:

            * g++.dg/reflect/annotations14.C: New test.

    Reviewed-by: Jason Merrill <jason@redhat.com>


More information about the Gcc-bugs mailing list