Bug#493776: vim: c++ indent can't handle constructor initializer list syntax

Leo Moisio leo.moisio at gmail.com
Mon Aug 4 20:27:30 UTC 2008

Package: vim
Version: 1:7.1.314-3+b1
Severity: normal

// Here's a sample file plaa.cc:
class a {
		a() : i(0)

		a() : i(0) {


		a() {
		int i_;
// end of plaa.cc

Started editor like this:

vim -u NONE -U NONE plaa.cc

Ran the following commands:

:filetype plugin indent on
:syntax on

And then reindent the whole file by =G and the end result is as you can see

Everything else is ok, except for the first constructor that has an initializer
list and then the { on the next line. The indent is one level too little,
compared to all the other functions.

Often the line containing the constructor signature and the initializer list is
much longer and needs to be split to separate lines, but then vim can't indent
the function body properly anymore, so this is quite annoying.

Leo Moisio

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vim depends on:
ii  libacl1                   2.2.47-2       Access control list shared library
ii  libc6                     2.7-13         GNU C Library: Shared libraries
ii  libgpm2                   1.20.4-2       General Purpose Mouse - shared lib
ii  libncurses5               5.6+20080713-1 shared libraries for terminal hand
ii  libselinux1               2.0.65-2       SELinux shared libraries
ii  vim-common                1:7.1.314-3+b1 Vi IMproved - Common files
ii  vim-runtime               1:7.1.314-3    Vi IMproved - Runtime files

vim recommends no packages.

Versions of packages vim suggests:
pn  ctags                         <none>     (no description available)
pn  vim-doc                       <none>     (no description available)
pn  vim-scripts                   <none>     (no description available)

-- no debconf information

More information about the pkg-vim-maintainers mailing list