diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2012-06-06 13:41:22 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-06-06 14:55:07 +0200 |
commit | 23c637c4f677ab2f19793f409297b0131b21dcaa (patch) | |
tree | c940f0eddbc83bfc5ba3ee9e39c3833f45729cde /src/libs/cplusplus/ResolveExpression.cpp | |
parent | b88a5f5d381b4279f6aa93e1400d78d910f1ed15 (diff) | |
download | qt-creator-23c637c4f677ab2f19793f409297b0131b21dcaa.tar.gz |
C++: Introduce unicode char/strings support
Those are the types char16_t and char32_t along with the new
char/string literals u'', U'', u"", u8"", and U"".
This is particularly important for the use of QStringLiteral
since in some platforms it relies on expansion such as above.
Note: The string literals quickfixes still need some tunning.
Task-number: QTCREATORBUG-7449
Change-Id: Iebcfea15677dc8e0ebb6143def89a5477e1be7d4
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/libs/cplusplus/ResolveExpression.cpp')
-rw-r--r-- | src/libs/cplusplus/ResolveExpression.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index 4678d014f6..4d3a75b174 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -289,13 +289,16 @@ bool ResolveExpression::visit(NumericLiteralAST *ast) Type *type = 0; bool isUnsigned = false; - if (tk.is(T_CHAR_LITERAL)) + if (tk.is(T_CHAR_LITERAL)) { type = control()->integerType(IntegerType::Char); - else if (tk.is(T_WIDE_CHAR_LITERAL)) + } else if (tk.is(T_WIDE_CHAR_LITERAL)) { type = control()->integerType(IntegerType::WideChar); - else if (const NumericLiteral *literal = numericLiteral(ast->literal_token)) { + } else if (tk.is(T_UTF16_CHAR_LITERAL)) { + type = control()->integerType(IntegerType::Char16); + } else if (tk.is(T_UTF32_CHAR_LITERAL)) { + type = control()->integerType(IntegerType::Char32); + } else if (const NumericLiteral *literal = numericLiteral(ast->literal_token)) { isUnsigned = literal->isUnsigned(); - if (literal->isInt()) type = control()->integerType(IntegerType::Int); else if (literal->isLong()) |