https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123866
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:477a1ff545a5e0d2b49f117fae49797d5405c4f9 commit r16-7898-g477a1ff545a5e0d2b49f117fae49797d5405c4f9 Author: Jakub Jelinek <[email protected]> Date: Wed Mar 4 19:22:29 2026 +0100 c++: Find annotations in DECL_ATTRIBUTES (TYPE_NAME (r)) for type aliases On Wed, Feb 25, 2026 at 08:50:40PM +0100, Jakub Jelinek wrote: > > Sounds like the maybe_strip_typedefs is wrong, since reflection in general > > tries to preserve aliases. > > Actually the maybe_strip_typedefs call is correct, that is for the type > argument (so when it is std::meta::annotations_with_type) and the standard > says that dealias should be used > - https://eel.is/c++draft/meta.reflection#annotation-6.2 > But we probably shouldn't use TYPE_ATTRIBUTES but DECL_ATTRIBUTES (TYPE_NAME (r)) > if r is a type alias. > I'll test a patch for that separately. Here it is. 2026-03-04 Jakub Jelinek <[email protected]> PR c++/123866 * reflect.cc (eval_annotations_of): For type aliases look for annotations in DECL_ATTRIBUTES (TYPE_NAME (r)). * g++.dg/reflect/annotations11.C: New test.
