[cfe-commits] r58802 - in /cfe/trunk: include/clang/Basic/TokenKinds.def lib/Parse/ParseExpr.cpp

Douglas Gregor doug.gregor at gmail.com
Thu Nov 6 07:17:29 PST 2008


Author: dgregor
Date: Thu Nov  6 09:17:27 2008
New Revision: 58802

URL: http://llvm.org/viewvc/llvm-project?rev=58802&view=rev
Log:
Add the remaining C++0x keywords

Modified:
    cfe/trunk/include/clang/Basic/TokenKinds.def
    cfe/trunk/lib/Parse/ParseExpr.cpp

Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=58802&r1=58801&r2=58802&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Thu Nov  6 09:17:27 2008
@@ -268,9 +268,19 @@
 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)

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=58802&r1=58801&r2=58802&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Thu Nov  6 09:17:27 2008
@@ -348,6 +348,7 @@
 ///         '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 @@
   }
   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 @@
 ///         '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();





More information about the cfe-commits mailing list