1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 375739: #ifdef nested in macro-expansion.

This commit is contained in:
Markus Schorn 2012-04-03 15:56:25 +02:00
parent 7bceb81ed5
commit b82f3de2e3
2 changed files with 17 additions and 1 deletions

View file

@ -263,6 +263,22 @@ public class PreprocessorBugsTests extends PreprocessorTestsBase {
validateProblemCount(2); // the inclusions
}
// #define UNFOLD(v,x) v:x
// UNFOLD("A",
// #ifdef X
// "B")
// #else
// "C") /* parse error in this line */
// #endif
public void testDirectiveInExpansion_Bug375739() throws Exception {
initializeScanner();
validateString("A");
validateToken(IToken.tCOLON);
validateString("C");
validateEOF();
validateProblemCount(0);
}
// #if 0xe000
// ok
// #endif

View file

@ -224,7 +224,7 @@ final class ScannerContext {
cond.fTakeElse= false;
newState= cond.fInitialState;
} else if (withinExpansion) {
newState= CodeState.eParseInactive;
newState= CodeState.eSkipInactive;
} else {
newState= fInactiveState;
}