Subject: 23.3; cc-engine.el incorrectly classifies member-init-intro as member-init-cont

From: Ian Masters <[email-masked]>
Date: Fri, 01 Apr 2011 12:08:37 +0100

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your report will be posted to the [email-masked] mailing list
and the gnu.emacs.bug news group, and at http://debbugs.gnu.org.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':

To reproduce the issue:

1. Launch emacs

emacs -Q

2. Create a new buffer

C-x b test.cpp <RET>

3. Enter c++ mode

M-x c++-mode <RET>

4. Insert the following constructor which includes a member initializer
list:

Class::Class(int i)
:m_i(i)
{

}

5. With point on the initializer list on line 2 query the syntactic
information:

C-c C-s

which returns:

((member-init-cont 28))

6. Add a space at the beginning of line 2 to give:

Class::Class(int i)
 :m_i(i)
{

}

7. With point on the initializer list on line 2 query the syntactic
information again:

C-c C-s

now correctly identifies the line as intro rather than cont:

((member-init-intro 1))

8. The following change to lisp/progmodes/cc-engine.el fixes the issue:

8121c8121
<             (if (or (> tmp-pos indent-point)
---
>             (if (or (>= tmp-pos indent-point)

Thanks!

Ian

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/u/iim/tools/apps/Linux64/emacs/emacs-23.3/share/emacs/23.3/etc/DEBUG.

In GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.12.8)
 of 2011-04-01 on redlynch
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--prefix=/u/iim/tools/apps/Linux64/emacs/emacs-23.3''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> M-x b u <tab> <backspace> <backspace> r 
e [ p <backspace> <backspace> <tab> p o <tab> r t <tab> 
<return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list... [3 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug help-mode easymenu view
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
font-setting tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting gtk x-toolkit x multi-tty emacs)