From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Johnson Newsgroups: gmane.emacs.bugs Subject: bug#22864: C++11 code causes lisp errors in cc-mode and delete-selection-mode Date: Mon, 29 Feb 2016 15:49:16 -0700 Message-ID: <56D4CAEC.3080004@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1456789222 18809 80.91.229.3 (29 Feb 2016 23:40:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Feb 2016 23:40:22 +0000 (UTC) To: 22864@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 01 00:40:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aaXQ9-0002pI-QY for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Mar 2016 00:40:10 +0100 Original-Received: from localhost ([::1]:39798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaXQ9-00047f-7c for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Feb 2016 18:40:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaXQ5-000459-N7 for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 18:40:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaXQ2-000376-9k for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 18:40:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaXQ2-000370-6y for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 18:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aaXQ2-0003xE-2R for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 18:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ryan Johnson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Feb 2016 23:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22864 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145678916015137 (code B ref -1); Mon, 29 Feb 2016 23:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Feb 2016 23:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:54313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaXPL-0003w5-TY for submit@debbugs.gnu.org; Mon, 29 Feb 2016 18:39:20 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45317) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaWdI-0002il-LW for submit@debbugs.gnu.org; Mon, 29 Feb 2016 17:49:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaWdC-00066t-Jk for submit@debbugs.gnu.org; Mon, 29 Feb 2016 17:49:35 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaWdC-00066p-Gp for submit@debbugs.gnu.org; Mon, 29 Feb 2016 17:49:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaWdB-0007kP-6i for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 17:49:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaWd7-00066d-VK for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 17:49:33 -0500 Original-Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:33292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaWd7-00066Y-Om for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 17:49:29 -0500 Original-Received: by mail-oi0-x22b.google.com with SMTP id d205so33751743oia.0 for ; Mon, 29 Feb 2016 14:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=q0jMKCOePiqkHxFZKy0G4etICofNH/JQwGNUTAHqpO8=; b=tgCK74XcLERE1LDVWqYgM7XQtKwbU01v62+hht+U0/UordW/GyMXv6uhlQ+nVG8q4B 3kbdWPMJPlYrzq3LV1GF6Dg1pC+TraHcZXWf7auL0Mld6s/dIrGbGWk1pSt4r2etj50K IuRU0S+HfDqGfIcrY8sTPafs2vDFhBEB1OWhCVr0di17gLAy6I/UnApKXhBQ/4JWuxCf PNuqM/j5GUtwJW2ZTLiSfH6GZLSP1+38s6EERVSN8mY+7js8c5raS4X27dUNy/8otRQx LtxV8fPznaT8NszSG5jE3W/V0J40UWv68dFKtKFphbWARX19S6dHPKPHPjqac3Mk/uc6 IKGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=q0jMKCOePiqkHxFZKy0G4etICofNH/JQwGNUTAHqpO8=; b=HtP6wnyvVJjJN0xUSYC8i6pVpAxln839XuTNc79DOqM3pE48zNAX2wRN62oovBSV+A tMQQKqe0eUJLqDN/ZvJAOgLnSRrCzf0ZAOFBNTiKpVA/fPygpn4cycZNMWs6oT8zP7tW DP3Kt+E7JF5aKRNbiLyPsGaqSN01+a/qa6uh4FFSpbolnWCRMXxF9mRG2Bf1CIVbrr2g HjxkwWTdH4bcG2DCf1EzH/BHb1Eju3ldHqF+EXuYVRsnRE1GZ55mhTmKDd0eAfnF/V24 zAVypDZWI5pHvqr85fG+6W86PR3YuYCdwFGq7Bhc+5kR3bKEEsQTGHL4d6uWtOqBdLFc KYHQ== X-Gm-Message-State: AD7BkJJvdZTYdaNXKGX3A5AYJ4ntAlxgIMK2Gt0iF0SbiADN84MsRgab+wEKTobRbdOegA== X-Received: by 10.202.57.133 with SMTP id g127mr13254064oia.120.1456786168952; Mon, 29 Feb 2016 14:49:28 -0800 (PST) Original-Received: from [192.168.1.2] (75-162-194-230.slkc.qwest.net. [75.162.194.230]) by smtp.gmail.com with ESMTPSA id y196sm19636593oia.24.2016.02.29.14.49.27 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Feb 2016 14:49:27 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Mon, 29 Feb 2016 18:39:18 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:114181 Archived-At: The following (lexically valid) C++11 code confuses cc-mode, causing lisp errors that interrupt syntax highlighting and which break delete-selection-mode: $ cat font-lock-bug.cpp void a() { auto b = [](int c) { return c < 0; }; d({b}); } The above seems to be near-minimal: erasing either line in the body of `a` seems to avoid the problem. The bug affects both the Ubuntu 24.3.1 build I normally use and a hand-compiled 24.5.1 build. $ emacs -Q \ --eval "(setq font-lock-support-mode nil)" \ --eval "(toggle-debug-on-error)" \ font-lock-bug.cpp Invoking the above command immediately triggers the lisp backtrace below; I did a little source diving in hopes of finding a similar problem to the one in Bug #21205, but I was unable to penetrate the code. Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)") signal(error ("Invalid search bound (wrong side of point)")) byte-code("... snipped ..." [start err signal] 3) c-syntactic-re-search-forward(";" 56 t t) byte-code("... snipped ..." [start last-stmt-start lim move tentative-move beg c-beginning-of-statement-1 nil t looking-at c-backward-sws (59 125 58 nil) -1 "\\s(" macro 123 c-in-knr-argdecl throw return previous same syntax-table ((set-syntax-table c-with-syntax-table-orig-table)) set-syntax-table c++-mode c-syntactic-re-search-forward "[;={]" 61 c-backward-token-2 "[;{]" (byte-code "... snipped ..." [nil (byte-code "... snipped ..." [scan-lists 1] 4) ((error)) t] 3) ((error)) ";" c-opt-method-key c-recognize-knr-p knr-argdecl-start fallback-pos c-with-syntax-table-orig-table c-buffer-is-cc-mode c++-template-sy\ ntax-table c-overloadable-operators-regexp c-opt-op-identifier-prefix] 6) c-beginning-of-decl-1(1) #[(match-pos inside-macro) "... snipped ..." [start-pos c-not-decl-init-keywords c-macro-with-semi-re match-pos type context get-text-property face font-lock-keyword-face looking-at c-type (40 44 91 60) nil 40 -1 c-backward-token-2 t arglist c-decl-arg-start decl c-<>-arg-sep 60 <> put-text-property c-backward-sws c++-mode "\\(more\\)\\([^" "]\\|$\\)" 1 c-forward-sws c-forward-decl-or-cast-1 cast c-fontify-recorded-types-and-refs skip-syntax-backward "w_" 0 pike-mode "-!%&*+/<=>^|~[]()" "`" c-decl-type-start c-decl-id-start c-font-lock-declarators c-parse-state c-cheap-inside-bracelist-p (byte-code "... snipped... " [forward-list t] 1) ((error)) c-forward-token-2 41 c-on-identifier c-forward-label ...] 7](52 nil) c-find-decl-spots(66 "[[:alpha:]_]\\|\\(\\(?:::\\|\\?\\?-\\|compl\\>\\|~\\)\\)" (nil font-lock-type-face font-lock-constant-face font-lock-keyword-face) #[(match-pos inside-macro) "... snipped ..." [start-pos c-not-decl-init-keywords c-macro-with-semi-re match-pos type context get-text-property face font-lock-keyword-face looking-at c-type (40 44 91 60) nil 40 -1 c-backward-token-2 t arglist c-decl-arg-start decl c-<>-arg-sep 60 <> put-text-property c-backward-sws c++-mode "\\(more\\)\\([^" "]\\|$\\)" 1 c-forward-sws c-forward-decl-or-cast-1 cast c-fontify-recorded-types-and-refs skip-syntax-backward "w_" 0 pike-mode "-!%&*+/<=>^|~[]()" "`" c-decl-type-start c-decl-id-start c-font-lock-declarators c-parse-state c-cheap-inside-bracelist-p (byte-code "... snipped..." [forward-list t] 1) ((error)) c-forward-token-2 41 c-on-identifier c-forward-label ...] 7]) c-font-lock-declarations(66) font-lock-fontify-keywords-region(1 66 nil) font-lock-default-fontify-region(1 66 nil) c-font-lock-fontify-region(1 66 nil) font-lock-fontify-region(1 66 nil) byte-code("... snipped ..." [save-match-data-internal verbose font-lock-fontified match-data ((byte-code "... snipped..." [save-match-data-internal set-match-data evaporate] 3)) font-lock-fontify-region font-lock-after-fontify-buffer t] 4) font-lock-default-fontify-buffer() font-lock-fontify-buffer() font-lock-initial-fontify() font-lock-mode() turn-on-font-lock() turn-on-font-lock-if-desired() global-font-lock-mode-enable-in-buffers() run-hooks(after-change-major-mode-hook) run-mode-hooks(c++-mode-hook) c++-mode() set-auto-mode-0(c++-mode nil) set-auto-mode() normal-mode(t) after-find-file(nil t) find-file-noselect-1(# "~/font-lock-bug.cpp" nil nil "~/font-lock-bug.cpp" (197138636 64256)) find-file-noselect("/home/ryan/font-lock-bug.cpp" nil nil nil) find-file("/home/ryan/font-lock-bug.cpp") command-line-1(("--eval" "(setq font-lock-support-mode nil)" "--eval" "(toggle-debug-on-error)" "/home/ryan/font-lock-bug.cpp")) command-line() normal-top-level() Regards, Ryan