[gcc r15-3643] c++: avoid init_priority warning in system header
Jason Merrill
jason@gcc.gnu.org
Sat Sep 14 13:39:39 GMT 2024
https://gcc.gnu.org/g:8b5e54712a1efd1bf0c08a3d9523ab0c265e344a
commit r15-3643-g8b5e54712a1efd1bf0c08a3d9523ab0c265e344a
Author: Jason Merrill <jason@redhat.com>
Date: Sat Sep 14 11:46:22 2024 +0200
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:
---
gcc/cp/tree.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index 99088da9cee0..f43febed124c 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 %<init_priority%> %i is reserved for internal use",
More information about the Gcc-cvs
mailing list