[flang-commits] [flang] 13341ee - [flang][unittests] Silence compiler warning

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Jul 17 11:32:35 PDT 2023


Author: Peter Klausler
Date: 2023-07-17T11:30:30-07:00
New Revision: 13341eec1dc05ff729a55909061db80cced8945d

URL: https://github.com/llvm/llvm-project/commit/13341eec1dc05ff729a55909061db80cced8945d
DIFF: https://github.com/llvm/llvm-project/commit/13341eec1dc05ff729a55909061db80cced8945d.diff

LOG: [flang][unittests] Silence compiler warning

At least one compiler more recent that the one that I test with emits
a warning (valid but benign) for some code in a unit test that I
modified a few minutes ago.  Adding some curly braces to placate the
compiler.

Added: 
    

Modified: 
    flang/unittests/Runtime/ExternalIOTest.cpp

Removed: 
    


################################################################################
diff  --git a/flang/unittests/Runtime/ExternalIOTest.cpp b/flang/unittests/Runtime/ExternalIOTest.cpp
index bc1fb7faa43149..4f08505f05d0ad 100644
--- a/flang/unittests/Runtime/ExternalIOTest.cpp
+++ b/flang/unittests/Runtime/ExternalIOTest.cpp
@@ -529,12 +529,12 @@ TEST(ExternalIOTests, TestNonAvancingInput) {
   };
   // Actual non advancing input IO test
   TestItems inputItems[]{
-      {std::string(4, '+'), IostatOk, "ABCD", "ABCD"},
-      {std::string(4, '+'), IostatOk, "EFGH", "EFGH"},
-      {std::string(4, '+'), IostatEor, "++++", "    "},
-      {std::string(2, '+'), IostatOk, "IJ", "IJ"},
-      {std::string(8, '+'), IostatEor, "++++++++", "KLMNOP  "},
-      {std::string(10, '+'), IostatEor, "++++++++++", "QRSTUVWX  "},
+      {std::string(4, '+'), IostatOk, {"ABCD", "ABCD"}},
+      {std::string(4, '+'), IostatOk, {"EFGH", "EFGH"}},
+      {std::string(4, '+'), IostatEor, {"++++", "    "}},
+      {std::string(2, '+'), IostatOk, {"IJ", "IJ"}},
+      {std::string(8, '+'), IostatEor, {"++++++++", "KLMNOP  "}},
+      {std::string(10, '+'), IostatEor, {"++++++++++", "QRSTUVWX  "}},
   };
 
   // Test with PAD='NO'


        


More information about the flang-commits mailing list