[flang-commits] [flang] [FLANG][OPENMP] Fix handling of continuation lines in mixed OpenMP an… (PR #120714)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Fri Jan 3 04:21:30 PST 2025


================
@@ -1289,14 +1289,18 @@ const char *Prescanner::FreeFormContinuationLine(bool ampersand) {
     return nullptr;
   }
   p = SkipWhiteSpace(p);
-  if (InCompilerDirective()) {
-    if (*p++ != '!') {
-      return nullptr;
-    }
-    for (const char *s{directiveSentinel_}; *s != '\0'; ++p, ++s) {
-      if (*s != ToLowerCaseLetter(*p)) {
-        return nullptr;
+  if (*p == '!') {
+    ++p;
+    if (InCompilerDirective()) {
+      for (const char *s{directiveSentinel_}; *s != '\0'; ++p, ++s) {
+        if (*s != ToLowerCaseLetter(*p)) {
+          return nullptr;
+        }
       }
+    } else if (features_.IsEnabled(LanguageFeature::OpenMP)) {
----------------
luporl wrote:

```suggestion
    } else if (features_.IsEnabled(LanguageFeature::OpenMP) && *p == '$') {
```

This part is not checking if the current char is `'$'`.

https://github.com/llvm/llvm-project/pull/120714


More information about the flang-commits mailing list