Index: flang/include/flang/Common/format.h =================================================================== --- flang/include/flang/Common/format.h +++ flang/include/flang/Common/format.h @@ -149,9 +149,20 @@ int maxNesting_{0}; // max level of nested parentheses }; +template static inline bool IsWhite(CHAR c) { + // White space. ' ' is standard. Other characters are extensions. + // Extension candidates: + // '\t' (horizontal tab) + // '\n' (new line) + // '\v' (vertical tab) + // '\f' (form feed) + // '\r' (carriage ret) + return c == ' ' || c == '\t' || c == '\v'; +} + template CHAR FormatValidator::NextChar() { for (++cursor_; cursor_ < end_; ++cursor_) { - if (*cursor_ != ' ') { + if (!IsWhite(*cursor_)) { return toupper(*cursor_); } } @@ -161,7 +172,7 @@ template CHAR FormatValidator::LookAheadChar() { for (laCursor_ = cursor_ + 1; laCursor_ < end_; ++laCursor_) { - if (*laCursor_ != ' ') { + if (!IsWhite(*cursor_)) { return toupper(*laCursor_); } } Index: flang/test/Semantics/io08.f90 =================================================================== --- flang/test/Semantics/io08.f90 +++ flang/test/Semantics/io08.f90 @@ -37,6 +37,9 @@ write(*,'($)') write(*,'(\)') write(*,'(RZ,RU,RP,RN,RD,RC,SS,SP,S,3G15.3e2)') + write(*, '(' // achar( 9) // ')') ! horizontal tab + write(*, '(' // achar(11) // ')') ! vertical tab + write(*, '(' // achar(32) // ')') ! space ! C1302 warnings; no errors write(*,'(3P7I2)')