Compute the proper sourcerange for an CompoundLiteralExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45504 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 20118c2..0778bbd 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -704,7 +704,7 @@
if (CheckInitializer(literalExpr, literalType, false))
return 0;
- return new CompoundLiteralExpr(literalType, literalExpr);
+ return new CompoundLiteralExpr(LParenLoc, literalType, literalExpr);
}
Action::ExprResult Sema::
@@ -1982,7 +1982,7 @@
// Otherwise, create a compound literal expression as the base, and
// iteratively process the offsetof designators.
- Expr *Res = new CompoundLiteralExpr(ArgTy, 0);
+ Expr *Res = new CompoundLiteralExpr(SourceLocation(), ArgTy, 0);
// offsetof with non-identifier designators (e.g. "offsetof(x, a.b[c])") are a
// GCC extension, diagnose them.