[flang] Tune handling of LEN type parameter discrepancies on ALLOCATE
Presently, semantics doesn't check for discrepancies between known constant corresponding LEN type parameters between the declared type of an allocatable/pointer and either the type-spec or the SOURCE=/MOLD= on an ALLOCATE statement. This allows discrepancies between character lengths to go unchecked. Some compilers accept mismatched character lengths on SOURCE=/MOLD= and the allocate object, and that's useful and unambiguous feature that already works in f18 via truncation or padding. A portability warning should issue, however. But for mismatched character lengths between an allocate object and an explicit type-spec, and for any mismatch between derived type LEN type parameters, an error is appropriate. Differential Revision: https://reviews.llvm.org/D146583
Loading
Please register or sign in to comment