diff options
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 4d6eaa45c41..427f8f41100 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -2102,7 +2102,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, for (unsigned i = 0, e = StrLen; i != e; ++i) { llvm::APInt CodeUnit(PromotedCharTyWidth, SL->getCodeUnit(i)); Expr *Init = new (Context) IntegerLiteral( - Context, CodeUnit, PromotedCharTy, SourceLocation()); + Context, CodeUnit, PromotedCharTy, SubExpr->getExprLoc()); if (CharTy != PromotedCharTy) Init = ImplicitCastExpr::Create(Context, CharTy, CK_IntegralCast, Init, 0, VK_RValue); @@ -2124,7 +2124,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, for (unsigned i = 0, e = StrLen; i != e; ++i) { llvm::APInt CodeUnit(PromotedCharTyWidth, Str[i]); Expr *Init = new (Context) IntegerLiteral( - Context, CodeUnit, PromotedCharTy, SourceLocation()); + Context, CodeUnit, PromotedCharTy, SubExpr->getExprLoc()); if (CharTy != PromotedCharTy) Init = ImplicitCastExpr::Create(Context, CharTy, CK_IntegralCast, Init, 0, VK_RValue); |