[flang] Add data to a new formatted message.
authorpeter klausler <pklausler@nvidia.com>
Wed, 8 Aug 2018 18:37:40 +0000 (11:37 -0700)
committerpeter klausler <pklausler@nvidia.com>
Thu, 9 Aug 2018 17:17:43 +0000 (10:17 -0700)
Original-commit: flang-compiler/f18@04b1ae9e68cb5e21393e834229bb6964169fee29
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
Tree-same-pre-rewrite: false

flang/lib/evaluate/variable.cc

index adaaf4a..ba6aff3 100644 (file)
@@ -168,7 +168,8 @@ std::optional<std::string> Substring::Fold(FoldingContext &context) {
       std::int64_t len = str->size();
       if (ubi > len) {
         context.messages.Say(
-            "upper bound on substring (%jd) is greater than character length (%jd)"_en_US);
+            "upper bound on substring (%jd) is greater than character length (%jd)"_en_US,
+            static_cast<std::intmax_t>(ubi), static_cast<std::intmax_t>(len));
         ubi = len;
         last_ = SubscriptIntegerExpr{ubi};
       }