]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Make <meta> header compatible with -fno-asm
authorJonathan Wakely <jwakely@redhat.com>
Sat, 7 Mar 2026 11:24:29 +0000 (11:24 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 9 Mar 2026 18:12:57 +0000 (18:12 +0000)
We currently only use 'asm' in .cc files (where we control the build
flags) and in the experimental::simd headers. We could just say that
-fno-asm is not compatible with libstdc++ and so using it is not
supported, but we can also just make this small change.

libstdc++-v3/ChangeLog:

* include/std/meta (exception::what, access_context::via): Use
__asm__ instead of asm keyword.

Reviewed-by: Jakub Jelinek <jakub@redhat.com>
libstdc++-v3/include/std/meta

index 59a678037a164117098b063c39719ed6f06aaca0..2ed7708dcbf6c275ad13f7750e5710323c2573f7 100644 (file)
@@ -120,7 +120,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        // from UTF-8 to ordinary literal encoding failed.
        // In that case what() should be non-constant.
        if (_M_what.size() == 0 && _M_u8what.size() != 0)
-         asm("");
+         __asm__("");
        return _M_what.c_str();
       }
       consteval u8string_view u8what() const noexcept { return _M_u8what; }
@@ -599,7 +599,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                                       "or complete class type reflection",
                                     ^^access_context::via);
 #else
-         asm("");
+         __asm__("");
          return *this;
 #endif
        }