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

Package:
vim
Source:
vim
Description:
Vi IMproved - enhanced vi editor
Submitter:
"Leo Moisio"
Date:
2015-08-02 04:54:03 UTC
Severity:
normal
#493776#5
Date:
2008-08-04 20:27:30 UTC
From:
To:
// Here's a sample file plaa.cc:
class a {
	public:
		a() : i(0)
	{
	}

		a() : i(0) {
		}

		a()
		{
		}

		a() {
		}
	private:
		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
above.

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