logging: fix build error when using gcc with -Wmissing-braces
authorAdam Simpkins <simpkins@fb.com>
Wed, 10 Jan 2018 20:29:05 +0000 (12:29 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 10 Jan 2018 20:40:46 +0000 (12:40 -0800)
Summary:
Since std::array is actually a struct containing an array it technically
requires double braces around its initializer.  The language allows eliding
these braces, and clang doesn't complain about only using a single brace, but
gcc does when using `-Wmissing-braces`.

Reviewed By: yfeldblum

Differential Revision: D6695289

fbshipit-source-id: 913fcfbea4164a02d001bd2344e340c0b6ee62aa

folly/experimental/logging/LogLevel.cpp

index fc09b00..e8fc5e6 100644 (file)
@@ -33,10 +33,10 @@ struct NumberedLevelInfo {
   StringPiece upperPrefix;
 };
 
-constexpr std::array<NumberedLevelInfo, 2> numberedLogLevels = {
+constexpr std::array<NumberedLevelInfo, 2> numberedLogLevels = {{
     NumberedLevelInfo{LogLevel::DBG, LogLevel::DBG0, "dbg", "DBG"},
     NumberedLevelInfo{LogLevel::INFO, LogLevel::INFO0, "info", "INFO"},
-};
+}};
 } // namespace
 
 LogLevel stringToLogLevel(StringPiece name) {