Skip to content

Commit 2325371

Browse files
committed
remove standard checks
1 parent 65c5ed6 commit 2325371

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

simplecpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3726,7 +3726,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
37263726
continue;
37273727
}
37283728
} else if (rawtok->str() == IF || rawtok->str() == IFDEF || rawtok->str() == IFNDEF || rawtok->str() == ELIF ||
3729-
((getCStd(dui.std) >= C23 || getCppStd(dui.std) >= CPP23) && (rawtok->str() == ELIFDEF || rawtok->str() == ELIFNDEF))) {
3729+
rawtok->str() == ELIFDEF || rawtok->str() == ELIFNDEF) {
37303730
if (!sameline(rawtok,rawtok->next)) {
37313731
if (outputList) {
37323732
simplecpp::Output out{

test.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,9 +2372,6 @@ static void elif()
23722372

23732373
static void elifdef()
23742374
{
2375-
simplecpp::DUI dui;
2376-
dui.std = "c++23";
2377-
23782375
{
23792376
const char code[] = "#if 1\n"
23802377
"1\n"
@@ -2383,7 +2380,7 @@ static void elifdef()
23832380
"#else\n"
23842381
"3\n"
23852382
"#endif";
2386-
ASSERT_EQUALS("\n1", preprocess(code, dui));
2383+
ASSERT_EQUALS("\n1", preprocess(code));
23872384
}
23882385
{
23892386
const char code[] = "#define X\n"
@@ -2394,7 +2391,7 @@ static void elifdef()
23942391
"#else\n"
23952392
"3\n"
23962393
"#endif";
2397-
ASSERT_EQUALS("\n\n\n\n2", preprocess(code, dui));
2394+
ASSERT_EQUALS("\n\n\n\n2", preprocess(code));
23982395
}
23992396
{
24002397
const char code[] = "#if 0\n"
@@ -2404,15 +2401,12 @@ static void elifdef()
24042401
"#else\n"
24052402
"3\n"
24062403
"#endif";
2407-
ASSERT_EQUALS("\n\n\n\n\n3", preprocess(code, dui));
2404+
ASSERT_EQUALS("\n\n\n\n\n3", preprocess(code));
24082405
}
24092406
}
24102407

24112408
static void elifndef()
24122409
{
2413-
simplecpp::DUI dui;
2414-
dui.std = "c++23";
2415-
24162410
{
24172411
const char code[] = "#if 1\n"
24182412
"1\n"
@@ -2421,7 +2415,7 @@ static void elifndef()
24212415
"#else\n"
24222416
"3\n"
24232417
"#endif";
2424-
ASSERT_EQUALS("\n1", preprocess(code, dui));
2418+
ASSERT_EQUALS("\n1", preprocess(code));
24252419
}
24262420
{
24272421
const char code[] = "#if 0\n"
@@ -2431,7 +2425,7 @@ static void elifndef()
24312425
"#else\n"
24322426
"3\n"
24332427
"#endif";
2434-
ASSERT_EQUALS("\n\n\n2", preprocess(code, dui));
2428+
ASSERT_EQUALS("\n\n\n2", preprocess(code));
24352429
}
24362430
{
24372431
const char code[] = "#define X\n"
@@ -2442,7 +2436,7 @@ static void elifndef()
24422436
"#else\n"
24432437
"3\n"
24442438
"#endif";
2445-
ASSERT_EQUALS("\n\n\n\n\n\n3", preprocess(code, dui));
2439+
ASSERT_EQUALS("\n\n\n\n\n\n3", preprocess(code));
24462440
}
24472441
}
24482442

0 commit comments

Comments
 (0)