emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#22864: closed (C++11 code causes lisp errors in cc


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#22864: closed (C++11 code causes lisp errors in cc-mode and delete-selection-mode)
Date: Tue, 01 Mar 2016 01:47:02 +0000

Your message dated Tue, 01 Mar 2016 02:45:53 +0100
with message-id <address@hidden>
and subject line Re: bug#22864: C++11 code causes lisp errors in cc-mode and 
delete-selection-mode
has caused the debbugs.gnu.org bug report #22864,
regarding C++11 code causes lisp errors in cc-mode and delete-selection-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
22864: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22864
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: C++11 code causes lisp errors in cc-mode and delete-selection-mode Date: Mon, 29 Feb 2016 15:49:16 -0700 User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 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(#<buffer font-lock-bug.cpp> "~/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




--- End Message ---
--- Begin Message --- Subject: Re: bug#22864: C++11 code causes lisp errors in cc-mode and delete-selection-mode Date: Tue, 01 Mar 2016 02:45:53 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
Ryan Johnson <address@hidden> writes:

> 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});
> }

Thanks. This seems fixed in the upcoming 25.1 version which contains
improved support for C++XX.

Closing.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]