Skip to main content



      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 14:05
Eclipse UserFriend
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: Tue Jul 08 22:05:33 EDT 2025

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

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

Back to the top