diff options
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaCXX/pascal-wchar-strings.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 55155efa696..13ac32dcb13 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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) diff --git a/clang/test/SemaCXX/pascal-wchar-strings.cpp b/clang/test/SemaCXX/pascal-wchar-strings.cpp new file mode 100644 index 00000000000..db80b68b37e --- /dev/null +++ b/clang/test/SemaCXX/pascal-wchar-strings.cpp @@ -0,0 +1,2 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s -fpascal-strings +const wchar_t *pascalString = L"\pThis is a Pascal string"; |

