From: Jason Merrill Date: Sat, 14 Sep 2024 09:46:22 +0000 (+0200) Subject: c++: avoid init_priority warning in system header X-Git-Tag: basepoints/gcc-16~5910 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b5e54712a1efd1bf0c08a3d9523ab0c265e344a;p=thirdparty%2Fgcc.git c++: avoid init_priority warning in system header We don't want a warning about a reserved init_priority in a system header even with -Wsystem-headers. gcc/cp/ChangeLog: * tree.cc (handle_init_priority_attribute): Check in_system_header_at. --- diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index 99088da9cee..f43febed124 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -5196,7 +5196,8 @@ handle_init_priority_attribute (tree* node, /* Check for init_priorities that are reserved for language and runtime support implementations.*/ - if (pri <= MAX_RESERVED_INIT_PRIORITY) + if (pri <= MAX_RESERVED_INIT_PRIORITY + && !in_system_header_at (input_location)) { warning (0, "requested % %i is reserved for internal use",