Subject: Re: bug#64069: 30.0.50; Mistyped shy group regexps

From: Alan Mackenzie <[email-masked]>
Date: Thu, 15 Jun 2023 20:58:38 +0000

Hello, Basil.

On Wed, Jun 14, 2023 at 17:43:39 +0100, Basil Contovounesios wrote:
> Severity: minor
> Tags: patch

> Further to https://bugs.gnu.org/64019#14, I attach a patch which tweaks
> four redundant or seemingly mistyped instances of \(:?...\), i.e. a
> numbered group starting with an optional colon in place of the likelier
> shy group.

> CCing:
> - Alan to review the change to c-or-c++-mode--regexp

Yes, that looks like a bug, just as you've surmised.

There are also three other occurrences of \(:? in CC Mode, namely in
cc-langs.el.

I will fix all of these in master.

[ .... ]

> diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
> index 11a1d3fe6c2..5cf9b7e17f8 100644
> --- a/lisp/progmodes/cc-mode.el
> +++ b/lisp/progmodes/cc-mode.el
> @@ -2859,7 +2859,7 @@ c-or-c++-mode--regexp
>                                       "\\|" id "::"
>                                       "\\|" id ws-maybe "=\\)"
>                "\\|" "\\(?:inline" ws "\\)?namespace"
> -                    "\\(:?" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
> +                    "\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
>                "\\|" "class"     ws id
>                      "\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]"
>                "\\|" "struct"     ws id "\\(?:" ws "final" ws-maybe "[:{\n]"

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).