[clang-tools-extra] r344046 - [clang-tidy] NFC fix warnings from missing braces

Jonas Toth via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 9 06:29:31 PDT 2018


Author: jonastoth
Date: Tue Oct  9 06:29:31 2018
New Revision: 344046

URL: http://llvm.org/viewvc/llvm-project?rev=344046&view=rev
Log:
[clang-tidy] NFC fix warnings from missing braces

The std::array create multiple StringRef but did not wrap
them in braces. Some compilers warned for that. Adding the
braces is not possible and result in a compilation error.
This commit changes the array to vector which works without warning.

Modified:
    clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp?rev=344046&r1=344045&r2=344046&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp Tue Oct  9 06:29:31 2018
@@ -17,11 +17,12 @@ namespace clang {
 namespace tidy {
 namespace modernize {
 
-static const std::array<StringRef, 5> DeprecatedTypes = {
-    "::std::ios_base::io_state",  "::std::ios_base::open_mode",
-    "::std::ios_base::seek_dir",  "::std::ios_base::streamoff",
-    "::std::ios_base::streampos",
-};
+static const llvm::SmallVector<StringRef, 5> DeprecatedTypes = {
+    {"::std::ios_base::io_state"},
+    {"::std::ios_base::open_mode"},
+    {"::std::ios_base::seek_dir"},
+    {"::std::ios_base::streamoff"},
+    {"::std::ios_base::streampos"}};
 
 static const llvm::StringMap<StringRef> ReplacementTypes = {
     {"io_state", "iostate"},




More information about the cfe-commits mailing list