diff options
author | Peter Klausler <35819229+klausler@users.noreply.github.com> | 2024-01-25 14:20:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 14:20:16 -0800 |
commit | 3bca8506ab65c66e32695ba50571c4384be8e4d1 (patch) | |
tree | 9bb50f17469c35bbb278ce4e970977e2f78dd86a /flang/lib/Evaluate/intrinsics.cpp | |
parent | e9309b27d7bd50ee98fd7813214ac37716bd6978 (diff) | |
download | llvm-3bca8506ab65c66e32695ba50571c4384be8e4d1.zip llvm-3bca8506ab65c66e32695ba50571c4384be8e4d1.tar.gz llvm-3bca8506ab65c66e32695ba50571c4384be8e4d1.tar.bz2 |
[flang] Correct checking of PRESENT() (#78364)
The argument to the PRESENT() intrinsic function must be the name of a a
whole OPTIONAL dummy argument.
Fixes llvm-test-suite/Fortran/gfortran/regression/present_1.f90.
Diffstat (limited to 'flang/lib/Evaluate/intrinsics.cpp')
-rw-r--r-- | flang/lib/Evaluate/intrinsics.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp index 7d2e45d..e3a9d54 100644 --- a/flang/lib/Evaluate/intrinsics.cpp +++ b/flang/lib/Evaluate/intrinsics.cpp @@ -2896,8 +2896,6 @@ static bool ApplySpecificChecks(SpecificCall &call, FoldingContext &context) { arg ? arg->sourceLocation() : context.messages().at(), "Argument of ALLOCATED() must be an ALLOCATABLE object or component"_err_en_US); } - } else if (name == "associated" || name == "reduce") { - // Now handled in Semantics/check-call.cpp } else if (name == "atomic_and" || name == "atomic_or" || name == "atomic_xor") { return CheckForCoindexedObject( @@ -2939,20 +2937,6 @@ static bool ApplySpecificChecks(SpecificCall &call, FoldingContext &context) { arg ? arg->sourceLocation() : context.messages().at(), "Argument of LOC() must be an object or procedure"_err_en_US); } - } else if (name == "present") { - const auto &arg{call.arguments[0]}; - if (arg) { - if (const auto *expr{arg->UnwrapExpr()}) { - if (const Symbol *symbol{UnwrapWholeSymbolDataRef(*expr)}) { - ok = symbol->attrs().test(semantics::Attr::OPTIONAL); - } - } - } - if (!ok) { - context.messages().Say( - arg ? arg->sourceLocation() : context.messages().at(), - "Argument of PRESENT() must be the name of an OPTIONAL dummy argument"_err_en_US); - } } else if (name == "ucobound") { return CheckDimAgainstCorank(call, context); } |