1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-08 17:45:24 +02:00

Bug 394048 - parser confusion about octal double

Change-Id: I4184acdeb4909022a2e2b30830530bd33a4897f3
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Reviewed-on: https://git.eclipse.org/r/15839
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 2013-08-25 23:18:15 -04:00 committed by Sergey Prigogin
parent 5cb56f98bc
commit c68190a67c
2 changed files with 13 additions and 3 deletions

View file

@ -7461,4 +7461,9 @@ public class AST2Tests extends AST2TestBase {
public void testFunctionReturningFunctionPointer_413204() throws Exception { public void testFunctionReturningFunctionPointer_413204() throws Exception {
parseAndCheckBindings(getAboveComment(), CPP); parseAndCheckBindings(getAboveComment(), CPP);
} }
// double d = 00.9;
public void testOctalFloatingPointLiteral_394048() throws Exception {
parseAndCheckBindings();
}
} }

View file

@ -976,12 +976,17 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
++pos; ++pos;
break; break;
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7':
isOctal = true; if (!isFloat)
isOctal = true;
++pos; ++pos;
break; break;
case '8': case '9': case '8': case '9':
handleProblem(IProblem.SCANNER_BAD_OCTAL_FORMAT, image, number.getOffset(), number.getEndOffset()); if (!isFloat) {
return; handleProblem(IProblem.SCANNER_BAD_OCTAL_FORMAT, image, number.getOffset(), number.getEndOffset());
return;
}
++pos;
break;
} }
} }
} }