diff options
author | Anders Carlsson <andersca@mac.com> | 2011-04-06 18:42:48 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-04-06 18:42:48 +0000 |
commit | 96b4adce3bd41a33e3f1d98dc4e74046585f6dce (patch) | |
tree | a6688c112b02f02bcc5085c2cdebc93bbc56e3d5 /lib/Sema/SemaExpr.cpp | |
parent | 759abb4d9ec14ae32104a9677b60f0542b60d1d8 (diff) |
Wide Pascal strings should be of type wchar_t[] and not unsigned char[].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 55155efa69..13ac32dcb1 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -744,8 +744,10 @@ Sema::ActOnStringLiteral(const Token *StringToks, unsigned NumStringToks) { StringTokLocs.push_back(StringToks[i].getLocation()); QualType StrTy = Context.CharTy; - if (Literal.AnyWide) StrTy = Context.getWCharType(); - if (Literal.Pascal) StrTy = Context.UnsignedCharTy; + if (Literal.AnyWide) + StrTy = Context.getWCharType(); + else if (Literal.Pascal) + StrTy = Context.UnsignedCharTy; // A C++ string literal has a const-qualified element type (C++ 2.13.4p1). if (getLangOptions().CPlusPlus || getLangOptions().ConstStrings) |