We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f6768c commit 943c704Copy full SHA for 943c704
flang/lib/Parser/preprocessor.cpp
@@ -414,7 +414,7 @@ std::optional<TokenSequence> Preprocessor::MacroReplacement(
414
const TokenSequence &input, Prescanner &prescanner,
415
std::optional<std::size_t> *partialFunctionLikeMacro, bool inIfExpression) {
416
// Do quick scan for any use of a defined name.
417
- if (definitions_.empty()) {
+ if (!inIfExpression && definitions_.empty()) {
418
return std::nullopt;
419
}
420
std::size_t tokens{input.SizeInTokens()};
flang/test/Preprocessing/no-pp-if.f90
@@ -0,0 +1,10 @@
1
+!RUN: %flang -fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2
+!CHECK-NOT: ERROR STOP
3
+!CHECK: CONTINUE
4
+#if defined UNDEFINED
5
+error stop
6
+#endif
7
+#if !defined UNDEFINED
8
+continue
9
10
+end
0 commit comments