aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Lex/LiteralSupport.cpp1
-rw-r--r--lib/Lex/PPExpressions.cpp8
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp
index 398082ff70..0324c0b012 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -680,6 +680,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
PP.Diag(Loc, diag::ext_multichar_character_literal);
else
PP.Diag(Loc, diag::ext_four_char_character_literal);
+ IsMultiChar = true;
}
// Transfer the value from APInt to uint64_t
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 47c3f8d1c7..709e316b80 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/lib/Lex/PPExpressions.cpp
@@ -221,8 +221,12 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
// Character literals are always int or wchar_t, expand to intmax_t.
TargetInfo &TI = PP.getTargetInfo();
- unsigned NumBits = TI.getCharWidth(Literal.isWide());
-
+ unsigned NumBits;
+ if (Literal.isMultiChar())
+ NumBits = TI.getIntWidth();
+ else
+ NumBits = TI.getCharWidth(Literal.isWide());
+
// Set the width.
llvm::APSInt Val(NumBits);
// Set the value.