Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Incorrect class member indentation influenced by base class specifier
Incorrect class member indentation influenced by base class specifier [message #894590] Mon, 09 July 2012 18:05
Brandon Phillips is currently offline Brandon PhillipsFriend
Messages: 3
Registered: July 2012
Junior Member
I noticed my class members were being indented too much despite all the style options I tried. It seems to be influenced by the structure of the class definition, specifically the base class specification. Here's an easy way to reproduce in Indigo or Juno(20120614-1722) with any canned style (K&R shown).

Starting with a class defined like this:
class foo : public bar {
};


Hit enter after the open brace and you get one level indent:
class foo : public bar {
    int x;
};


But start with this:
class foo
  : public bar
{
};


Hit enter after the open brace and you get two levels of indent:
class foo
  : public bar
{
      int x;
};


The position of the : seems to be what confuses things. The formatter doesn't really like this style for the base class specifier (I have to format it manually), but that does not justify unrelated indentation errors, does it?
Previous Topic:Hackystat with CDT
Next Topic:C programs don't run in interactive mode in CDT
Goto Forum:
  


Current Time: Thu Apr 25 18:12:44 GMT 2024

Powered by FUDForum. Page generated in 0.02842 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top