GNU bug report logs - #53605
CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted

Previous Next

Package: cc-mode;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Fri, 28 Jan 2022 14:55:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Richard Copley <rcopley <at> gmail.com>
Cc: 53605 <at> debbugs.gnu.org
Subject: bug#53605: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted
Date: Sat, 29 Jan 2022 11:34:44 +0000
Hello, Richard.

Thanks for the bug report.

On Fri, Jan 28, 2022 at 14:53:20 +0000, Richard Copley wrote:
> Package: cc-mode
> Hi Alan,

> The code below (which is valid since C++11) is mishighlighted,
> with the open-paren after "_opcode" in font-lock-warning face
> and the subsequent characters in font-lock-string-face. This is
> unstable: inserting and deleting a character before the open-
> paren fixes the highlighting, and [M-x normal-mode RET] breaks
> it again.

> <<END
> #include <cstddef>
> int operator""_opcode(const char *p, std::size_t size) {
>   return 0;
> }
> END

It looks like the r""_opcode( has been mistaken for the raw string
delimiter R""_opcode(, and the ( is in warning face because there's no
matching closing delimiter.  case-fold-search ought to be nil here, but
appears not to be.  And the check for the "R" ought to exclude other
alphanumeric characters.

I'll have a closer look at it in the next few days.  I'm a bit short of
time right at the moment.  (Sorry.)

> Emacs  : GNU Emacs 29.0.50 (build 3, x86_64-w64-mingw32)
>  of 2022-01-28 (on master)
> Package: CC Mode 5.35.1 (C++//l)
> Buffer Style: gnu
> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes
> gen-string-delim gen-comment-delim syntax-properties 1-bit)

[ .... thanks for the (snipped) status dump! ]

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 3 years and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.