On Tue, Jan 13, 2026 at 01:07:06PM +0100, Jakub Jelinek wrote: > On Tue, Jan 13, 2026 at 06:45:11PM +0800, Jason Merrill wrote: > > > Or shall I go the copy_node way for array_as_string instead? > > > > copy_node sounds better to me. > > So like this if it passes full bootstrap/regtest? > So far it passed > GXX_TESTSUITE_STDS=98,20,26 make check-gcc check-g++ > RUNTESTFLAGS="dg.exp='pr101312* W*parameter* attr-access* Warr*bound* > Wbuiltin-decl*'" > i.e. tests from this PR and tests which do use the array_as_string > hack.
This passed full bootstrap/regtest on x86_64-linux and i686-linux. > 2026-01-13 Jakub Jelinek <[email protected]> > > PR c/101312 > gcc/ > * langhooks.h (struct lang_hooks_for_types): Remove > copy_lang_qualifiers. Add build_lang_qualified_type. > * langhooks.cc (lhd_build_lang_qualified_type): New function. > * langhooks-def.h (lhd_build_lang_qualified_type): Declare. > (LANG_HOOKS_COPY_LANG_QUALIFIERS): Remove. > (LANG_HOOKS_BUILD_LANG_QUALIFIED_TYPE): Add. > (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use > LANG_HOOKS_BUILD_LANG_QUALIFIED_TYPE instead of > LANG_HOOKS_COPY_LANG_QUALIFIERS. > * attribs.cc (build_type_attribute_qual_variant): Use > lang_hooks.types.build_lang_qualified_type instead of > build_qualified_type and/or build_qualified_type with > optional lang_hooks.types.copy_lang_qualifiers call. > (attr_access::array_as_string): Use "array " attribute instead of > "array". If attribute has been created or intended quals differ > from quals of build_array_type, use copy_node and adjust quals and > attributes on the copy, print and then ggc_free. > gcc/c-family/ > * c-pretty-print.cc (c_pretty_printer::direct_abstract_declarator): > Look up "array " attribute instead of "array". > gcc/c/ > * c-tree.h (c_build_lang_qualified_type): Declare. > * c-objc-common.h (LANG_HOOKS_BUILD_LANG_QUALIFIED_TYPE): Define. > * c-objc-common.cc (c_build_lang_qualified_type): New function. > gcc/cp/ > * cp-tree.h (cxx_build_lang_qualified_type): Declare. > * cp-objcp-common.h (LANG_HOOKS_COPY_LANG_QUALIFIERS): Remove. > (LANG_HOOKS_BUILD_LANG_QUALIFIED_TYPE): Define. > * tree.cc (cxx_build_lang_qualified_type): New function. > gcc/testsuite/ > * c-c++-common/pr101312-1.c: New test. > * c-c++-common/pr101312-2.c: New test. Jakub
