[flang-commits] [PATCH] D135217: [flang] Supply missing source location for a message

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Oct 6 14:45:20 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe66ff2a284de: [flang] Supply missing source location for a message (authored by klausler).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135217

Files:
  flang/lib/Semantics/check-select-type.cpp
  flang/test/Semantics/selecttype01.f90


Index: flang/test/Semantics/selecttype01.f90
===================================================================
--- flang/test/Semantics/selecttype01.f90
+++ flang/test/Semantics/selecttype01.f90
@@ -50,6 +50,8 @@
     select type ( a )
       !ERROR: The type specification statement must have LEN type parameter as assumed
       type is ( character(len=10) ) !<-- assumed length-type
+      !ERROR: The type specification statement must have LEN type parameter as assumed
+      type is ( character )
       ! OK
       type is ( character(len=*) )
       !ERROR: The type specification statement must have LEN type parameter as assumed
Index: flang/lib/Semantics/check-select-type.cpp
===================================================================
--- flang/lib/Semantics/check-select-type.cpp
+++ flang/lib/Semantics/check-select-type.cpp
@@ -94,7 +94,8 @@
                 }
                 if (spec->category() == DeclTypeSpec::Character &&
                     !guardDynamicType.IsAssumedLengthCharacter()) { // C1160
-                  context_.Say(parser::FindSourceLocation(typeSpec),
+                  auto location{parser::FindSourceLocation(typeSpec)};
+                  context_.Say(location.empty() ? stmt.source : location,
                       "The type specification statement must have "
                       "LEN type parameter as assumed"_err_en_US);
                   typeSpecRetVal = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135217.465886.patch
Type: text/x-patch
Size: 1429 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221006/5e44a3f1/attachment.bin>


More information about the flang-commits mailing list