PR4283: Don't truncate multibyte character constants in the
preprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72686 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 47c3f8d..709e316 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/lib/Lex/PPExpressions.cpp
@@ -221,8 +221,12 @@
// 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.