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:
parent
7bceb81ed5
commit
b82f3de2e3
2 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue