[llvm-bugs] [Bug 30767] New: Warning about braces on the normative statement of how to initialize a std::array.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 22 14:03:22 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30767

            Bug ID: 30767
           Summary: Warning about braces on the normative statement of how
                    to initialize a std::array.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bmoses at google.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

In the C++11 standard, [array.overview] paragraph 2 basically gives the
following as a normative statement of how to initialize a std::array.

  #include <array>
  void f(const int& x) {
    std::array<int, 3> y = {x, x, x};
  }

However, Clang warns on this, with "suggest braces around initialization of
subobject".  See, e.g., https://godbolt.org/g/lZ3tn3.

It seems a bit weird to get a warning on things that the standard considers
normative!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161022/480e9aa9/attachment.html>


More information about the llvm-bugs mailing list