On Thu, 22 Aug 2024, Marc Poulhiès wrote:

> Single argument static_assert is C++17 only.
> 
> libcpp/ChangeLog:
> 
>       * lex.cc: fix static_assert to use 2 arguments.

When pushing, please fix the entry to mention the function name if that's
not too much trouble:

        * lex.cc (search_line_ssse3): Fix static_assert to use 2 arguments.

> ---
> OK for master?

Ah, sorry for missing that. I hope someone will approve it for you in a moment
(in any case you can push it yourself under the "obvious patch" rule).

If you want to add an error message instead of "", I could suggest
"host character encoding is ASCII", but it is probably unnecessary.

Alexander

> 
>  libcpp/lex.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libcpp/lex.cc b/libcpp/lex.cc
> index daf2c770bc3..402a2e42f46 100644
> --- a/libcpp/lex.cc
> +++ b/libcpp/lex.cc
> @@ -355,7 +355,7 @@ search_line_ssse3 (const uchar *s, const uchar *end 
> ATTRIBUTE_UNUSED)
>    /* Helper vector for pshufb-based matching:
>       each character C we're searching for is at position (C % 16).  */
>    v16qi lut = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\n', 0, '\\', '\r', 0, '?' };
> -  static_assert ('\n' == 10 && '\r' == 13 && '\\' == 92 && '?' == 63);
> +  static_assert ('\n' == 10 && '\r' == 13 && '\\' == 92 && '?' == 63, "");
>  
>    v16qi d1, d2, t1, t2;
>    /* Unaligned loads.  Reading beyond the final newline is safe,
> 

Reply via email to