llvm-project/clang/tools
Yunzhong Gao cb77930d6b Implementing C99 partial re-initialization behavior (DR-253)
Based on previous discussion on the mailing list, clang currently lacks support
for C99 partial re-initialization behavior:
Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html
Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm

This patch attempts to fix this problem.

Given the following code snippet,

struct P1 { char x[6]; };
struct LP1 { struct P1 p1; };

struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' };
// this example is adapted from the example for "struct fred x[]" in DR-253;
// currently clang produces in l: { "\0\0x" },
//   whereas gcc 4.8 produces { "fox" };
// with this fix, clang will also produce: { "fox" };


Differential Review: http://reviews.llvm.org/D5789

llvm-svn: 239446
2015-06-10 00:27:52 +00:00
..
arcmt-test Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
c-arcmt-test Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
c-index-test Revert r237339 as sanitizer-ppc64-linux1 does not like it. 2015-05-14 06:53:31 +00:00
clang-check Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
clang-format Fix terrible python goof in clang-format.py which broke my vim 2015-06-04 21:23:07 +00:00
clang-format-vs Fix clang-format build from the solution; the underlying path has changed to include the VS directory structure. 2015-05-12 14:41:39 +00:00
clang-fuzzer revert r237081 -- bad idea (-lcrypt may not be present) 2015-05-12 03:10:42 +00:00
diag-build Briefly document diag-build.sh 2013-12-28 21:59:11 +00:00
diagtool Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
driver range-for'ify Args->filtered_begin(...) loops 2015-06-09 01:57:17 +00:00
libclang Implementing C99 partial re-initialization behavior (DR-253) 2015-06-10 00:27:52 +00:00
scan-build Revert "[analyzer] scan-build: support spaces in compiler path and arguments." 2015-05-06 02:08:27 +00:00
scan-view [analyzer] scan-view: don't ever serve absolute paths. 2013-04-29 17:23:06 +00:00
CMakeLists.txt Add initial version of a clang-fuzzer. 2015-03-28 00:07:39 +00:00
Makefile Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00