diff options
-rw-r--r-- | Sema/SemaExpr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index a82d0ad7e5..72bedab464 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -157,8 +157,10 @@ Sema::ExprResult Sema::ActOnCharacterConstant(const Token &Tok) { Tok.getLocation(), PP); if (Literal.hadError()) return ExprResult(true); - return new CharacterLiteral(Literal.getValue(), Context.IntTy, - Tok.getLocation()); + + QualType type = getLangOptions().CPlusPlus ? Context.CharTy : Context.IntTy; + + return new CharacterLiteral(Literal.getValue(), type, Tok.getLocation()); } Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) { |