[flang-commits] [flang] [flang] Don't insert spaces in -E output after line continuation (PR #135063)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Apr 9 12:29:37 PDT 2025


================
@@ -155,7 +155,7 @@ void Parsing::EmitPreprocessedSource(
       const auto getOriginalChar{[&](char ch) {
         if (IsLetter(ch) && provenance && provenance->size() == 1) {
           if (const char *orig{allSources.GetSource(*provenance)}) {
-            const char upper{ToUpperCaseLetter(ch)};
+            char upper{ToUpperCaseLetter(ch)};
----------------
klausler wrote:

Because it's not a reference or a pointer, and `const` makes the reader (or at least me) wonder for a moment whether the object *should* have been a reference or a pointer, since it's a common coding error to omit the `&` or `*` since in those cases it's a value copy that compiles anyway.

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


More information about the flang-commits mailing list