This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix character initialization after continuation
ClosedPublic

Authored by luporl on Jun 1 2023, 6:44 AM.

Details

Summary

The insertion of a space on a line continuation right before
a character literal was confusing TokenSequence::ToLowerCase(),
that was unable to identify the character literal as such,
causing it to be converted to lower case.

Fix this by skipping spaces in the beginning and end of each
token, before testing for token type.

Fixes https://github.com/llvm/llvm-project/issues/62039

Diff Detail

Event Timeline

luporl created this revision.Jun 1 2023, 6:44 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a subscriber: sunshaoce. · View Herald Transcript
luporl published this revision for review.Jun 1 2023, 6:47 AM
klausler added inline comments.Jun 1 2023, 7:44 AM
flang/lib/Parser/token-sequence.cpp
158

Always use braced initialization in the parts of f18 that use modern C++, please, just like the immediately preceding line.

luporl updated this revision to Diff 527450.Jun 1 2023, 9:15 AM

Use braced initialization and rebase to current head.

luporl marked an inline comment as done.Jun 1 2023, 9:15 AM
klausler accepted this revision.Jun 1 2023, 9:15 AM
This revision is now accepted and ready to land.Jun 1 2023, 9:15 AM
This revision was automatically updated to reflect the committed changes.