diff options
author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2015-06-10 00:27:52 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2015-06-10 00:27:52 +0000 |
commit | e43fe24e6015b7fd936adaba4cd87bfa58f4bea0 (patch) | |
tree | adb3e981afeea3f0a797e11234f10b7fed0fb86d /include/clang/Basic/StmtNodes.td | |
parent | e8ce8c3b9606f34a3cd217c5bf4139105d8bcf91 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/StmtNodes.td')
-rw-r--r-- | include/clang/Basic/StmtNodes.td | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index 750108f39f..790250db8d 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -77,7 +77,9 @@ def CompoundLiteralExpr : DStmt<Expr>; def ExtVectorElementExpr : DStmt<Expr>; def InitListExpr : DStmt<Expr>; def DesignatedInitExpr : DStmt<Expr>; +def DesignatedInitUpdateExpr : DStmt<Expr>; def ImplicitValueInitExpr : DStmt<Expr>; +def NoInitExpr : DStmt<Expr>; def ParenListExpr : DStmt<Expr>; def VAArgExpr : DStmt<Expr>; def GenericSelectionExpr : DStmt<Expr>; |