[PATCH] D86357: [flang] Fix assert on bad character kind
Tim Keith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 22 10:12:05 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc0c3cafa2bda: [flang] Fix assert on bad character kind (authored by tskeith).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86357/new/
https://reviews.llvm.org/D86357
Files:
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/kinds02.f90
Index: flang/test/Semantics/kinds02.f90
===================================================================
--- flang/test/Semantics/kinds02.f90
+++ flang/test/Semantics/kinds02.f90
@@ -83,3 +83,9 @@
!ERROR: CHARACTER(KIND=8) is not a supported type
character(len=*), parameter :: cvar11 = 8_"abcd"
end program
+
+subroutine s(a, b)
+ character(*,2) :: a
+ !ERROR: KIND value (8) not valid for CHARACTER
+ character(*,8) :: b
+end
Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -3461,6 +3461,7 @@
TypeCategory::Character, *intKind)) { // C715, C719
Say(currStmtSource().value(),
"KIND value (%jd) not valid for CHARACTER"_err_en_US, *intKind);
+ charInfo_.kind = std::nullopt; // prevent further errors
}
if (x.length) {
charInfo_.length = GetParamValue(*x.length, common::TypeParamAttr::Len);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86357.287201.patch
Type: text/x-patch
Size: 992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200822/c4901c79/attachment.bin>
More information about the llvm-commits
mailing list