unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Iru Cai via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 56256@debbugs.gnu.org
Subject: bug#56256: Emacs 28.1 gets stuck when typing some C++ code
Date: Mon, 27 Jun 2022 18:22:15 +0800	[thread overview]
Message-ID: <c3dc99f1-4b36-5103-7b10-2074b862aed9@disroot.org> (raw)

Emacs gets stuck when trying to type the '&' character at the end of the 
buffer when there's the following code in C++ mode (this code is from 
https://www.gingerbill.org/article/2015/08/19/defer-in-cpp/):

```

template <typename F>
struct privDefer {
     F f;
     privDefer(F f) : f(f) {}
     ~privDefer() { f(); }
};

template <typename F>
privDefer<F> defer_func(F f) {
     return privDefer<F>(f);
}

#define DEFER_1(x, y) x##y
#define DEFER_2(x, y) DEFER_1(x, y)
#define DEFER_3(x)    DEFER_2(x, __COUNTER__)
#define defer(code) auto DEFER_3(_defer_) = defer_func([

```

Steps to reproduce:

1. create a C++ source file with this code and open it with Emacs, if 
the file doesn't have a C++ source suffix, enable c++mode

2. type the '&' symbol at the last line after "defer_func(["

3. then Emacs gets stuck

I can see this bug in Emacs 28.1 and git revision 
5b1bb1af030597aab7f7895b6e3da9b430f9438a. I've also tried ``emacs -Q`` 
and ``emacs -Q -nw``, the bug still exists.






             reply	other threads:[~2022-06-27 10:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 10:22 Iru Cai via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-06-28 12:52 ` bug#56256: Emacs 28.1 gets stuck when typing some C++ code Lars Ingebrigtsen
2022-06-28 16:28 ` Alan Mackenzie
2022-06-29  3:03   ` Iru Cai via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 16:23     ` 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=c3dc99f1-4b36-5103-7b10-2074b862aed9@disroot.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=56256@debbugs.gnu.org \
    --cc=vimacs@disroot.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).