Add the remaining C++0x keywords

llvm-svn: 58802
This commit is contained in:
Douglas Gregor 2008-11-06 15:17:27 +00:00
parent f178f8300d
commit d7fc872d5c
2 changed files with 16 additions and 1 deletions

View File

@ -268,9 +268,19 @@ CXX_KEYWORD_OPERATOR(xor , caret)
CXX_KEYWORD_OPERATOR(xor_eq , caretequal)
// C++0x keywords
KEYWORD(alignof , NOTC90|NOTC99|NOTCPP)
KEYWORD(axiom , NOTC90|NOTC99|NOTCPP)
KEYWORD(char16_t , NOTC90|NOTC99|NOTCPP)
KEYWORD(char32_t , NOTC90|NOTC99|NOTCPP)
KEYWORD(concept , NOTC90|NOTC99|NOTCPP)
KEYWORD(concept_map , NOTC90|NOTC99|NOTCPP)
KEYWORD(constexpr , NOTC90|NOTC99|NOTCPP)
KEYWORD(decltype , NOTC90|NOTC99|NOTCPP)
KEYWORD(late_check , NOTC90|NOTC99|NOTCPP)
KEYWORD(nullptr , NOTC90|NOTC99|NOTCPP)
KEYWORD(requires , NOTC90|NOTC99|NOTCPP)
KEYWORD(static_assert , NOTC90|NOTC99|NOTCPP)
KEYWORD(thread_local , NOTC90|NOTC99|NOTCPP)
// GNU Extensions.
KEYWORD(_Decimal32 , EXTC90|EXTC99|EXTCPP|EXTCPP0x)

View File

@ -348,6 +348,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, unsigned MinPrec) {
/// 'sizeof' '(' type-name ')'
/// [GNU] '__alignof' unary-expression
/// [GNU] '__alignof' '(' type-name ')'
/// [C++0x] 'alignof' '(' type-id ')'
/// [GNU] '&&' identifier
///
/// unary-operator: one of
@ -530,8 +531,10 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {
}
case tok::kw_sizeof: // unary-expression: 'sizeof' unary-expression
// unary-expression: 'sizeof' '(' type-name ')'
case tok::kw_alignof:
case tok::kw___alignof: // unary-expression: '__alignof' unary-expression
// unary-expression: '__alignof' '(' type-name ')'
// unary-expression: 'alignof' '(' type-id ')'
return ParseSizeofAlignofExpression();
case tok::ampamp: { // unary-expression: '&&' identifier
SourceLocation AmpAmpLoc = ConsumeToken();
@ -712,8 +715,10 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
/// 'sizeof' '(' type-name ')'
/// [GNU] '__alignof' unary-expression
/// [GNU] '__alignof' '(' type-name ')'
/// [C++0x] 'alignof' '(' type-id ')'
Parser::ExprResult Parser::ParseSizeofAlignofExpression() {
assert((Tok.is(tok::kw_sizeof) || Tok.is(tok::kw___alignof)) &&
assert((Tok.is(tok::kw_sizeof) || Tok.is(tok::kw___alignof)
|| Tok.is(tok::kw_alignof)) &&
"Not a sizeof/alignof expression!");
Token OpTok = Tok;
ConsumeToken();