[PATCH] libstdc++: Make <meta> header compatible with -fno-asm

Jakub Jelinek jakub@redhat.com
Mon Mar 9 17:37:04 GMT 2026


On Mon, Mar 09, 2026 at 05:12:15PM +0000, Jonathan Wakely wrote:
> libstdc++-v3/ChangeLog:
> 
> 	* include/std/meta (exception::what, access_context::via): Use
> 	__asm__ instead of asm keyword.

LGTM.

> diff --git a/libstdc++-v3/include/std/meta b/libstdc++-v3/include/std/meta
> index 59a678037a16..2ed7708dcbf6 100644
> --- a/libstdc++-v3/include/std/meta
> +++ b/libstdc++-v3/include/std/meta
> @@ -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
>  	}
> -- 
> 2.53.0

	Jakub



More information about the Libstdc++ mailing list