unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 62339@debbugs.gnu.org, acm@muc.de, Daniel Colascione <dancol@dancol.org>
Subject: bug#62339: cc-mode fontifies variables incorrectly when const follows type
Date: Wed, 22 Mar 2023 22:14:12 +0000	[thread overview]
Message-ID: <ZBt9tML14qM7pXOV@ACM> (raw)
In-Reply-To: <83ttyc6cqz.fsf@gnu.org>

Hello, Eli and Daniel.

Thanks for the bug report!

On Wed, Mar 22, 2023 at 17:12:52 +0200, Eli Zaretskii wrote:
> > From: Daniel Colascione <dancol@dancol.org>
> > Cc: 62339@debbugs.gnu.org
> > Date: Wed, 22 Mar 2023 10:19:55 -0400

> > This problem reproduces for me on latest master with emacs -Q:

> > ```
> > TEST(Foo, Bar) {
> >   NamedTemporaryDirectory const test_directory;
> > }
> > ```

> Thanks.  What I see with Emacs built from master is that
> test_directory in the above example gets font-lock-type-face in
> c++-mode (but not in c-mode).  With Emacs built from emacs-29, both
> modes produce correct fontification.

> Alan, can you please look into this?

I think this is caused by a faulty fix of bug #59267, where "typeless" C
declarations like

    const foo;

, which are implicit int, were not being recognised.

In the current test case, in C Mode, NamedTemporaryDirectory ought to be
getting fontified as a type, but isn't.  In C++ Mode, test_directory
gets spuriously fontified as a type, as already noted.

Seeing as how the current bug affects only the master branch, not the
emacs-29 branch, I think I'm going to take a bit of time to fix this bug
in the hope of fixing it properly this time.

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2023-03-22 22:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 15:14 bug#62339: cc-mode fontifies variables incorrectly when const follows type Daniel Colascione
2023-03-21 17:39 ` Eli Zaretskii
2023-03-22 14:19   ` Daniel Colascione
2023-03-22 15:12     ` Eli Zaretskii
2023-03-22 22:14       ` Alan Mackenzie [this message]
2023-03-22 22:17         ` Daniel Colascione
2023-03-23  0:42           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-23  2:02             ` Daniel Colascione
2023-03-23  5:45               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-23  7:22                 ` Eli Zaretskii
2023-03-23 14:40           ` Alan Mackenzie
2023-04-05 15:53             ` Alan Mackenzie
2023-04-06  3:16               ` Daniel Colascione
2023-04-06  9:26                 ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBt9tML14qM7pXOV@ACM \
    --to=acm@muc.de \
    --cc=62339@debbugs.gnu.org \
    --cc=dancol@dancol.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).