[gcc r17-2299] nvptx: Resolve 'flexible_array_member_type_p' conflict

Thomas Schwinge via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:44bf2e20c4eef737d461bfa566e78aaa3ad59948

commit r17-2299-g44bf2e20c4eef737d461bfa566e78aaa3ad59948
Author: Thomas Schwinge <[email protected]>
Date:   Fri Jul 10 00:52:46 2026 +0200

    nvptx: Resolve 'flexible_array_member_type_p' conflict
    
        [...]/source-gcc/gcc/config/nvptx/nvptx.cc:2485:1: error: ‘bool flexible_array_member_type_p(const_tree)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
         2485 | flexible_array_member_type_p (const_tree type)
              | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
        In file included from [...]/source-gcc/gcc/config/nvptx/nvptx.cc:30:
        [...]/source-gcc/gcc/tree.h:7022:13: note: previous declaration of ‘bool flexible_array_member_type_p(const_tree)’
         7022 | extern bool flexible_array_member_type_p (const_tree);
              |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    That's due to recent commit ed1d15e94f5ce28a9fdba6e3b255efef420c93f0
    "c: harmonize checking for flex array member type".
    
            gcc/
            * config/nvptx/nvptx.cc (flexible_array_member_type_p): Rename to
            'nvptx_flexible_array_member_type_p'.

Diff:
---
 gcc/config/nvptx/nvptx.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index a23206910dc4..fb76e7813507 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -2482,7 +2482,7 @@ nvptx_output_ascii (FILE *, const char *str, unsigned HOST_WIDE_INT size)
    given dimension.  */
 
 static bool
-flexible_array_member_type_p (const_tree type)
+nvptx_flexible_array_member_type_p (const_tree type)
 {
   if (TREE_CODE (type) != RECORD_TYPE)
     return false;
@@ -2520,7 +2520,7 @@ nvptx_assemble_decl_begin (FILE *file, const char *name, const char *section,
   bool atype = (TREE_CODE (type) == ARRAY_TYPE)
     && (TYPE_DOMAIN (type) == NULL_TREE);
 
-  if (undefined && flexible_array_member_type_p (type))
+  if (undefined && nvptx_flexible_array_member_type_p (type))
     {
       size = 0;
       atype = true;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.