summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-02-03 18:21:45 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-02-03 18:21:45 +0000
commiteb1df70bdc8ba12c287da438434ae294c006e304 (patch)
tree5f20a7f012797189450260fa1afcb1fc8c20a204 /clang/lib
parente3ee332fe090b86910fbf59496788878b93cff38 (diff)
downloadbcm5719-llvm-eb1df70bdc8ba12c287da438434ae294c006e304.tar.gz
bcm5719-llvm-eb1df70bdc8ba12c287da438434ae294c006e304.zip
Fix for PR6220: compute the correct type for multicharacter literals.
llvm-svn: 95228
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index ec57a039a86..99714aee361 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1668,6 +1668,8 @@ Sema::OwningExprResult Sema::ActOnCharacterConstant(const Token &Tok) {
Ty = Context.IntTy; // 'x' and L'x' -> int in C.
else if (Literal.isWide())
Ty = Context.WCharTy; // L'x' -> wchar_t in C++.
+ else if (Literal.isMultiChar())
+ Ty = Context.IntTy; // 'wxyz' -> int in C++.
else
Ty = Context.CharTy; // 'x' -> char in C++
OpenPOWER on IntegriCloud