* bug#22864: C++11 code causes lisp errors in cc-mode and delete-selection-mode
@ 2016-02-29 22:49 Ryan Johnson
2016-03-01 1:45 ` Óscar Fuentes
0 siblings, 1 reply; 2+ messages in thread
From: Ryan Johnson @ 2016-02-29 22:49 UTC (permalink / raw)
To: 22864
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#22864: C++11 code causes lisp errors in cc-mode and delete-selection-mode
2016-02-29 22:49 bug#22864: C++11 code causes lisp errors in cc-mode and delete-selection-mode Ryan Johnson
@ 2016-03-01 1:45 ` Óscar Fuentes
0 siblings, 0 replies; 2+ messages in thread
From: Óscar Fuentes @ 2016-03-01 1:45 UTC (permalink / raw)
To: Ryan Johnson; +Cc: 22864-done
Ryan Johnson <scovich@gmail.com> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-01 1:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-29 22:49 bug#22864: C++11 code causes lisp errors in cc-mode and delete-selection-mode Ryan Johnson
2016-03-01 1:45 ` Óscar Fuentes
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.