[cfe-commits] r38868 - /cfe/cfe/trunk/Parse/ParseExpr.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:25:20 PDT 2007
Author: sabre
Date: Wed Jul 11 11:25:20 2007
New Revision: 38868
URL: http://llvm.org/viewvc/llvm-project?rev=38868&view=rev
Log:
Implement parsing of casts, implementing Parser/statements.c:test6
Modified:
cfe/cfe/trunk/Parse/ParseExpr.cpp
Modified: cfe/cfe/trunk/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseExpr.cpp?rev=38868&r1=38867&r2=38868&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/ParseExpr.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExpr.cpp Wed Jul 11 11:25:20 2007
@@ -21,6 +21,10 @@
// FIXME: STUB.
if (Tok.getKind() == tok::l_brace) {
ConsumeBrace();
+
+ if (Tok.getKind() == tok::numeric_constant)
+ ConsumeToken();
+
// FIXME: initializer-list
// Match the '}'.
MatchRHSPunctuation(tok::r_brace, Tok.getLocation(), "{",
@@ -53,7 +57,7 @@
if (Tok.getKind() != tok::l_paren)
return ParseUnaryExpression();
- ParenParseOption ParenExprType = CompoundLiteral;
+ ParenParseOption ParenExprType = CastExpr;
ParseParenExpression(ParenExprType);
switch (ParenExprType) {
@@ -62,7 +66,8 @@
case CompoundLiteral:
// We parsed '(' type-name ')' '{' ... '}'. If any suffixes of
// postfix-expression exist, parse them now.
- assert(0 && "FIXME");
+ //Diag(Tok, diag::err_parse_error);
+ //assert(0 && "FIXME");
break;
case CastExpr:
// We parsed '(' type-name ')' and the thing after it wasn't a '{'. Parse
@@ -70,8 +75,6 @@
ParseCastExpression();
break;
}
- // If ParenExprType could have a postfix expr after it, handle it now.
- assert(0);
}
/// ParseUnaryExpression
More information about the cfe-commits
mailing list