mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
Bug 330747: Octal char constants in preprocessing condition.
This commit is contained in:
parent
49de2e7452
commit
c18d5df1fd
2 changed files with 20 additions and 1 deletions
|
@ -308,4 +308,23 @@ public class PreprocessorBugsTests extends PreprocessorTestsBase {
|
|||
validateString("unsignedint f();");
|
||||
validateEOF();
|
||||
}
|
||||
|
||||
// #if '\0'
|
||||
// no
|
||||
// #else
|
||||
// yes
|
||||
// #endif
|
||||
// #if '\1'
|
||||
// yes
|
||||
// #else
|
||||
// no
|
||||
// #endif
|
||||
public void testOcatalCharConstant_Bug330747() throws Exception {
|
||||
initializeScanner();
|
||||
validateIdentifier("yes");
|
||||
validateIdentifier("yes");
|
||||
validateEOF();
|
||||
validateProblemCount(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ public class ExpressionEvaluator {
|
|||
case 'v': return 0xb;
|
||||
|
||||
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7':
|
||||
return getNumber(tokenImage, i+1, tokenImage.length-1, 8, IProblem.SCANNER_BAD_OCTAL_FORMAT);
|
||||
return getNumber(tokenImage, i, tokenImage.length-1, 8, IProblem.SCANNER_BAD_OCTAL_FORMAT);
|
||||
|
||||
case 'x': case 'u': case 'U':
|
||||
return getNumber(tokenImage, i+1, tokenImage.length-1, 16, IProblem.SCANNER_BAD_HEX_FORMAT);
|
||||
|
|
Loading…
Add table
Reference in a new issue