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

Bug 365498 - Strange warning placement for defaulted constructor

Change-Id: Ia80fbd9694310aff0900e80cb9175e101c653604
Reviewed-on: https://git.eclipse.org/r/9065
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2012-12-05 22:15:23 -05:00 committed by Sergey Prigogin
parent bb97b889b2
commit 1289cc3a6e
2 changed files with 10 additions and 1 deletions

View file

@ -577,4 +577,13 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
runOnProject(); runOnProject();
checkNoErrors(); checkNoErrors();
} }
// struct S {
// int i;
// S() = default;
// };
public void testBug365498_defaultedConstructor() throws Exception{
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
} }

View file

@ -2521,7 +2521,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
default: default:
throwBacktrack(kind); throwBacktrack(kind);
} }
return adjustEndOffset(fdef, consume(IToken.tSEMI).getEndOffset()); return setRange(fdef, firstOffset, consume(IToken.tSEMI).getEndOffset());
} }
if (LT(1) == IToken.tCOLON) { if (LT(1) == IToken.tCOLON) {