1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 398459 - Invalid auto-indentation in a virtual method

This commit is contained in:
Sergey Prigogin 2013-01-17 16:02:35 -08:00
parent 98e5959c90
commit adb89806d8
2 changed files with 12 additions and 3 deletions

View file

@ -432,7 +432,7 @@ public class CIndenterTest extends BaseUITestCase {
//class MyClass { //class MyClass {
//typedef int MyType; //typedef int MyType;
//public: //public:
//int getA() { //virtual int getA() {
//return a; //return a;
//} //}
//MyClass(); //MyClass();
@ -444,7 +444,7 @@ public class CIndenterTest extends BaseUITestCase {
//class MyClass { //class MyClass {
// typedef int MyType; // typedef int MyType;
// public: // public:
// int getA() { // virtual int getA() {
// return a; // return a;
// } // }
// MyClass(); // MyClass();

View file

@ -1409,8 +1409,17 @@ public final class CIndenter {
case Symbols.TokenPRIVATE: case Symbols.TokenPRIVATE:
case Symbols.TokenPROTECTED: case Symbols.TokenPROTECTED:
case Symbols.TokenPUBLIC: case Symbols.TokenPUBLIC:
case Symbols.TokenVIRTUAL:
continue; // Don't stop at colon in a class declaration continue; // Don't stop at colon in a class declaration
case Symbols.TokenVIRTUAL:
switch (peekToken()) {
case Symbols.TokenPRIVATE:
case Symbols.TokenPROTECTED:
case Symbols.TokenPUBLIC:
break;
default:
continue;
}
} }
int pos= fPreviousPos; int pos= fPreviousPos;
if (!isConditional()) if (!isConditional())