[flang-commits] [PATCH] D84290: [Flang] Fix for the scenario when type guard has intrinsic type specification and Selector is NOT unlimited Polymorphic.

Inderjeet via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jul 27 17:12:44 PDT 2020


inderjeet-hcl marked 2 inline comments as done.
inderjeet-hcl added a comment.

Kindly check reply inline and suggest.



================
Comment at: flang/lib/Semantics/check-select-type.cpp:77
+    const parser::TypeGuardStmt &typeGuardStmt{stmt.statement};
+    const auto &guard{std::get<parser::TypeGuardStmt::Guard>(typeGuardStmt.t)};
     return std::visit(
----------------
inderjeet-hcl wrote:
> sameeranjoshi wrote:
> > Can you please use `GetGuardFromStmt` here? 
> ok, I will update source code.
GetGuardFromStmt is defined in struct TypeCase and can not be called from PassesChecksOnGuard as we do not have object of class TypeCase in function PassesChecksOnGuard.
Kindly suggest if I should pass object of class TypeCase as a parameter to PassesChecksOnGuard or we can keep above modifications without calling GetGuardFromStmt.


================
Comment at: flang/test/Semantics/selecttype01.f90:131
   select type (a => x)
+  !ERROR : Intrinsic type specification must not be specified
   type is (integer)
----------------
sameeranjoshi wrote:
> inderjeet-hcl wrote:
> > sameeranjoshi wrote:
> > > Is this error correct? 
> > > I see `check-flang` failing for both the files.
> > > Did you verify `check-flang` before submitting this patch?
> > > 
> > sorry, I was not aware of the option check-flang. I will test it before submitting updated files.
> > 
> > Error seems correct, selector should be unlimited Polymorphic in case of Intrinsic type specification.
> > Function ReportConflictingTypeCases is generating 'INTEGER*4' in error message instead of 'integer' which is specified in test case. Do you have any idea how to update function ReportConflictingTypeCases to display correct name ?
> `4` specifies kind type parameter.
> I am speaking of
> `!ERROR : Intrinsic type specification must not be specified` 
> replaced with
> `!ERROR : If selector is not unlimited polymorphic, an intrinsic type specification must not be specified in the type guard statement`
I will update comment.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84290/new/

https://reviews.llvm.org/D84290





More information about the flang-commits mailing list