https://gcc.gnu.org/g:ee5514629e647bc918be312e066b87cfa22f8177

commit r17-2054-gee5514629e647bc918be312e066b87cfa22f8177
Author: Jakub Jelinek <[email protected]>
Date:   Wed Jul 1 12:33:57 2026 +0200

    aarch64: Fix recent changes to be C++14 compatible
    
    Last night I've noticed
    ../../gcc/config/aarch64/aarch64-neon-builtins-base.h:23:11: warning: 
nested namespace definitions only available with -std=c++17 or -std=gnu++17 
[-Wpedantic]
    ../../gcc/config/aarch64/aarch64-neon-builtins-shapes.cc:128:11: warning: 
nested namespace definitions only available with -std=c++17 or -std=gnu++17 
[-Wpedantic]
    ../../gcc/config/aarch64/aarch64-neon-builtins-shapes.h:23:11: warning: 
nested namespace definitions only available with -std=c++17 or -std=gnu++17 
[-Wpedantic]
    warnings.  GCC 17 is still supposed to be buildable by C++14 compilers
    (including GCC 5.4).
    The following patch fixes that to use what the backend uses elsewhere.
    
    2026-07-01  Jakub Jelinek  <[email protected]>
    
            * config/aarch64/aarch64-neon-builtins-base.h: Use
            namespace aarch64_acle { namespace functions { ... } } instead of
            C++17 namespace aarch64_acle::functions { ... }.
            * config/aarch64/aarch64-neon-builtins-shapes.h: Use
            namespace aarch64_acle { namespace shapes { ... } } instead of
            C++17 namespace aarch64_acle::shapes { ... }.
            * config/aarch64/aarch64-neon-builtins-shapes.cc: Likewise.
    
    Reviewed-by: Kyrylo Tkachov <[email protected]>
    Reviewed-by: Tamar Christina <[email protected]>

Diff:
---
 gcc/config/aarch64/aarch64-neon-builtins-base.h    |  6 ++++--
 gcc/config/aarch64/aarch64-neon-builtins-shapes.cc | 10 ++++++----
 gcc/config/aarch64/aarch64-neon-builtins-shapes.h  |  6 ++++--
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-neon-builtins-base.h 
b/gcc/config/aarch64/aarch64-neon-builtins-base.h
index 9612bef42f26..33065700daed 100644
--- a/gcc/config/aarch64/aarch64-neon-builtins-base.h
+++ b/gcc/config/aarch64/aarch64-neon-builtins-base.h
@@ -20,10 +20,12 @@
 #ifndef GCC_AARCH64_NEON_BUILTINS_BASE_H
 #define GCC_AARCH64_NEON_BUILTINS_BASE_H
 
-namespace aarch64_acle::functions {
+namespace aarch64_acle {
+  namespace functions {
 #define DEF_NEON_FUNCTION(NAME, ...) \
-  extern const aarch64_acle::function_base *const NAME;
+    extern const aarch64_acle::function_base *const NAME;
 #include "aarch64-neon-builtins.def"
+  }
 }
 
 #endif
diff --git a/gcc/config/aarch64/aarch64-neon-builtins-shapes.cc 
b/gcc/config/aarch64/aarch64-neon-builtins-shapes.cc
index dbc4cf5ff7a8..c50fb4d4f8c5 100644
--- a/gcc/config/aarch64/aarch64-neon-builtins-shapes.cc
+++ b/gcc/config/aarch64/aarch64-neon-builtins-shapes.cc
@@ -125,10 +125,12 @@ struct neon_shape : public function_shape
   tree resolve (function_resolver &) const override { gcc_unreachable (); }
 };
 
-namespace aarch64_acle::shapes {
+namespace aarch64_acle {
+  namespace shapes {
 #define DEF_NEON_FUNCTION(NAME, TYPES, SHAPE_ARGS)                     \
-  static constexpr const neon_shape OBJ_NAME (NAME, TYPES) SHAPE_ARGS; \
-  const aarch64_acle::function_shape *SHAPE_NAME (NAME, TYPES)         \
-    = &OBJ_NAME (NAME, TYPES);
+    static constexpr const neon_shape OBJ_NAME (NAME, TYPES) SHAPE_ARGS;\
+    const aarch64_acle::function_shape *SHAPE_NAME (NAME, TYPES)       \
+      = &OBJ_NAME (NAME, TYPES);
 #include "aarch64-neon-builtins.def"
+  }
 }
diff --git a/gcc/config/aarch64/aarch64-neon-builtins-shapes.h 
b/gcc/config/aarch64/aarch64-neon-builtins-shapes.h
index c94f4c994643..47607c20bd60 100644
--- a/gcc/config/aarch64/aarch64-neon-builtins-shapes.h
+++ b/gcc/config/aarch64/aarch64-neon-builtins-shapes.h
@@ -20,10 +20,12 @@
 #ifndef GCC_AARCH64_NEON_BUILTINS_SHAPES_H
 #define GCC_AARCH64_NEON_BUILTINS_SHAPES_H
 
-namespace aarch64_acle::shapes {
+namespace aarch64_acle {
+  namespace shapes {
 #define DEF_NEON_FUNCTION(NAME, TYPES, SHAPE_ARGS) \
-  extern const aarch64_acle::function_shape *const SHAPE_NAME (NAME, TYPES);
+    extern const aarch64_acle::function_shape *const SHAPE_NAME (NAME, TYPES);
 #include "aarch64-neon-builtins.def"
+  }
 }
 
 #endif

Reply via email to