This is an archive of the discontinued LLVM Phabricator instance.

[flang] Portability warning and documentation for an obscure extension
ClosedPublic

Authored by klausler on Jul 21 2023, 8:41 AM.

Details

Summary

A quotation mark can appear in a Fortran character literal by doubling
it; for example, PRINT *, "'""'" prints '"'. When those doubled
quotation marks are split by a free form line continuation, the
continuation line should have an ampersand before the second quotation
mark. But most compilers, including this one, allow the second
quotation mark to appear as the first character on the continuation
line, too.

So this works:

print *, "'"&

"'"

but it really should be written as:

print *, "'"&

&"'"

Emit a portability warning and document that we support this near-universal
extension.

Diff Detail

Event Timeline

klausler created this revision.Jul 21 2023, 8:41 AM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.Jul 21 2023, 8:41 AM
This revision is now accepted and ready to land.Jul 21 2023, 9:10 AM