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

sameeran joshi via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jul 27 04:19:40 PDT 2020


sameeranjoshi added a comment.

Thank you for working !
This patch builds successfully but fails for `check-flang` for me.



================
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(
----------------
Can you please use `GetGuardFromStmt` here? 


================
Comment at: flang/lib/Semantics/check-select-type.cpp:103
+              } else {
+                const DerivedTypeSpec *derived{spec->AsDerived()};
+                typeSpecRetVal = PassesDerivedTypeChecks(
----------------
`DeclTypeSpec::AsDerived` might return `nullptr`. Please wrap it in some conditional statement.


================
Comment at: flang/test/Semantics/selecttype01.f90:131
   select type (a => x)
+  !ERROR : Intrinsic type specification must not be specified
   type is (integer)
----------------
Is this error correct? 
I see `check-flang` failing for both the files.
Did you verify `check-flang` before submitting this patch?



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

https://reviews.llvm.org/D84290





More information about the flang-commits mailing list