Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion flang/lib/Evaluate/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,7 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
messages.Say("'kind=' argument must be a constant scalar integer "
"whose value is a supported kind for the "
"intrinsic result type"_err_en_US);
return std::nullopt;
// use default kind below for error recovery
} else if (kindDummyArg->flags.test(ArgFlag::defaultsToSameKind)) {
CHECK(sameArg);
resultType = *sameArg->GetType();
Expand All @@ -2274,6 +2274,8 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
DynamicType{TypeCategory::Integer, defaults.sizeIntegerKind()};
} else {
CHECK(kindDummyArg->flags.test(ArgFlag::defaultsToDefaultForResult));
}
if (!resultType) {
int kind{defaults.GetDefaultKind(*category)};
if (*category == TypeCategory::Character) { // ACHAR & CHAR
resultType = DynamicType{kind, 1};
Expand Down
4 changes: 4 additions & 0 deletions flang/test/Semantics/kinds06.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!RUN: %python %S/test_errors.py %s %flang_fc1
!ERROR: 'kind=' argument must be a constant scalar integer whose value is a supported kind for the intrinsic result type
print *, real(1.,666)
end
Loading