Commit Graph

3 Commits

Author SHA1 Message Date
Peter Wu fa52e00c85 [Sema] Suppress additional warnings for C's zero initializer
Summary:
D28148 relaxed some checks for assigning { 0 } to a structure for all C
standards, but it failed to handle structures with non-integer
subobjects. Relax -Wmissing-braces checks for such structures, and add
some additional tests.

This fixes PR39931.

Patch By: al3xtjames

Reviewed By: Lekensteyn

Differential Revision: https://reviews.llvm.org/D61838

llvm-svn: 366163
2019-07-16 01:13:36 +00:00
Richard Smith 283e2076f6 Suppress -Wmissing-braces warning when aggregate-initializing a struct with a single field that is itself an aggregate.
In C++, such initialization of std::array<T, N> types is guaranteed to work by
the standard, is completely idiomatic, and the "suggested" alternative from
Clang was technically invalid.

llvm-svn: 314838
2017-10-03 20:36:00 +00:00
Daniel Marjamaki 817a3bfcdd [Sema] Suppress warnings for C's zero initializer
Patch by S. Gilles!

Differential Revision: https://reviews.llvm.org/D28148

llvm-svn: 314499
2017-09-29 09:44:41 +00:00