From 45fa5f9ccb67f01596e919b2e6e7b0275dc19362 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 24 Jun 2014 13:22:54 -0400 Subject: [PATCH] C++: Add a clarifying comment and TODO Change-Id: If6e6db7c4ca011159e78a27755ff9f665b179300 Reviewed-by: Wang Hoi Reviewed-by: Erik Verbruggen --- src/libs/3rdparty/cplusplus/Parser.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 333f1e88f89..2ed5afc54c8 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -2651,6 +2651,25 @@ bool Parser::parseBraceOrEqualInitializer0x(ExpressionAST *&node) return false; } +/* + initializer-clause: + assignment-expression + braced-init-list + designated-initializer + + If the next token is a T_LBRACKET, it could be the begin of either + + * a C++11 lambda-introducer (parsed by parseAssignmentExpression) + * or a C99 designator (parsed by parseDesignatedInitializer). + + Because currently C99 and C++11 Support is activated at the same time, + first try to parse the assignment-expression. If this fails, try to + parse a designated-initializer. + + TODO: + As soon as there will be only "one active language", parse either + the assignment-expression or the designated-initializer, not both. + */ bool Parser::parseInitializerClause0x(ExpressionAST *&node) { DEBUG_THIS_RULE();