From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Iru Cai via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56256: Emacs 28.1 gets stuck when typing some C++ code Date: Mon, 27 Jun 2022 18:22:15 +0800 Message-ID: Reply-To: Iru Cai Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10685"; mail-complaints-to="usenet@ciao.gmane.io" To: 56256@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 27 14:32:55 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5nvD-0002Xq-3P for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 14:32:55 +0200 Original-Received: from localhost ([::1]:51292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5nvB-0005HR-Ep for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 08:32:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5nuM-0005Dv-MP for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 08:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5nuM-00057J-DI for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 08:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5nuM-0007SO-B1 for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 08:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Iru Cai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Jun 2022 12:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56256 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165633309227126 (code B ref -1); Mon, 27 Jun 2022 12:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jun 2022 12:31:32 +0000 Original-Received: from localhost ([127.0.0.1]:50225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5ntr-000731-QH for submit@debbugs.gnu.org; Mon, 27 Jun 2022 08:31:32 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5lsu-0000h0-17 for submit@debbugs.gnu.org; Mon, 27 Jun 2022 06:22:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5lst-00025V-S3 for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 06:22:23 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:47370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5lsr-0004om-M5 for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 06:22:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 397B945AE1 for ; Mon, 27 Jun 2022 12:22:18 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AnVeoOyrOO4K for ; Mon, 27 Jun 2022 12:22:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1656325336; bh=4/N1Ggb4/iEIm4L3NzceNDvK9JAvhLoHLCQAm/3VdKg=; h=Date:From:Subject:To; b=JuzQtgNlOk2TytCqe8vv2muiUIZO2wXaR1SkUiakQlqdRtpSFJ+vSoiUc8kmWJ5VT 1H1w1oGoQ38gSj3R9BDXUp1iiju/UxiNt35eaXGxK6NQHs6SGecmu9CTRRkZE9gejM 5CKg1nGufX4UiPQ0AxYG3Zx7XQkkIGg9djWMCSefAV0+TLI7wVtX5u/n4DxCYtv0Xk EZVGLumTm0z9lLJzLaXnr+1B2LCXcaswCBVwGkOAAjtmQx5Ex3iZNNwGd8hdTc2BYp nyZEOFsPGUa229cqjUsxY08BluXFvj/D89V4Ph60ZCAy9riUQcUryWNCSlIthwZCfo N/zl+S/D7Nc/w== Content-Language: en-US Received-SPF: pass client-ip=178.21.23.139; envelope-from=vimacs@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 27 Jun 2022 08:31:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235442 Archived-At: 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 struct privDefer {     F f;     privDefer(F f) : f(f) {}     ~privDefer() { f(); } }; template privDefer defer_func(F f) {     return privDefer(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.