forked from OSchip/llvm-project
character literals have char type in C++ and int type in C. Patch
by Nuno Lopes for PR2089 llvm-svn: 47787
This commit is contained in:
parent
a683edb2d8
commit
ef24b38d9c
|
@ -157,8 +157,10 @@ Sema::ExprResult Sema::ActOnCharacterConstant(const Token &Tok) {
|
||||||
Tok.getLocation(), PP);
|
Tok.getLocation(), PP);
|
||||||
if (Literal.hadError())
|
if (Literal.hadError())
|
||||||
return ExprResult(true);
|
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) {
|
Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) {
|
||||||
|
|
Loading…
Reference in New Issue