aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 08:00:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 08:00:36 +0000
commit36f5cfe4df32af6c5fe01228102512996f566f9d (patch)
tree28e2c2562f781f6dbe711d15a00af596b21b9c9b /lib/Parse/ParseExpr.cpp
parent8a26fc15d4647da863f0cca73a203823b01da7e5 (diff)
Support for raw and template forms of numeric user-defined literals,
and lots of tidying up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 669b5b8ba4..c4627f1bba 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -700,7 +700,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
// constant: integer-constant
// constant: floating-constant
- Res = Actions.ActOnNumericConstant(Tok);
+ Res = Actions.ActOnNumericConstant(Tok, /*UDLScope*/getCurScope());
ConsumeToken();
break;
@@ -841,7 +841,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
case tok::wide_char_constant:
case tok::utf16_char_constant:
case tok::utf32_char_constant:
- Res = Actions.ActOnCharacterConstant(Tok);
+ Res = Actions.ActOnCharacterConstant(Tok, /*UDLScope*/getCurScope());
ConsumeToken();
break;
case tok::kw___func__: // primary-expression: __func__ [C99 6.4.2.2]
@@ -2120,18 +2120,13 @@ ExprResult Parser::ParseStringLiteralExpression(bool AllowUserDefinedLiteral) {
SmallVector<Token, 4> StringToks;
do {
- if (!AllowUserDefinedLiteral && Tok.hasUDSuffix()) {
- Diag(Tok, diag::err_invalid_string_udl);
- do ConsumeStringToken(); while (isTokenStringLiteral());
- return ExprError();
- }
-
StringToks.push_back(Tok);
ConsumeStringToken();
} while (isTokenStringLiteral());
// Pass the set of string tokens, ready for concatenation, to the actions.
- return Actions.ActOnStringLiteral(&StringToks[0], StringToks.size());
+ return Actions.ActOnStringLiteral(&StringToks[0], StringToks.size(),
+ AllowUserDefinedLiteral ? getCurScope() : 0);
}
/// ParseGenericSelectionExpression - Parse a C11 generic-selection