Lines Matching refs:Declarator
35 /// specifier-qualifier-list abstract-declarator[opt]
39 Declarator::TheContext Context,
55 // Parse the abstract-declarator, if present.
56 Declarator DeclaratorInfo(DS, Context);
1214 /// 'Context' should be a Declarator::TheContext value. This returns the
1279 /// declaration-specifiers init-declarator-list[opt] ';'
1281 /// init-declarator-list ';'
1282 ///[C90/C++]init-declarator-list ';' [TODO]
1286 /// attribute-specifier-seq[opt] type-specifier-seq declarator
1306 // declaration-specifiers init-declarator-list[opt] ';'
1321 /// Returns true if this might be the start of a declarator, or a common typo
1322 /// for a declarator.
1342 return Context == Declarator::MemberContext && getLangOpts().CPlusPlus11 &&
1346 return Context == Declarator::MemberContext || getLangOpts().CPlusPlus;
1372 return Context == Declarator::MemberContext ||
1373 (getLangOpts().CPlusPlus && Context == Declarator::FileContext);
1474 // Parse the first declarator.
1475 ParsingDeclarator D(*this, DS, static_cast<Declarator::TheContext>(Context));
1478 // Bail out if the first declarator didn't seem well-formed.
1527 // C++0x [stmt.iter]p1: Check if we have a for-range-declarator. If so, we
1551 bool ExpectSemi = Context != Declarator::ForContext;
1560 // the start of a declarator. The comma was probably a typo for a
1568 // Parse the next declarator.
1572 // Accept attributes in an init-declarator. In the first declarator in a
1574 // declarators, they become part of the declarator itself, so that they
1577 // short var __attribute__((common)); -> declarator
1578 // short x, __attribute__((common)) var; -> declarator
1594 ExpectAndConsumeSemi(Context == Declarator::FileContext
1613 /// declarator. Returns true on an error.
1614 bool Parser::ParseAsmAttributesAfterDeclarator(Declarator &D) {
1633 /// declarator'. This method parses the remainder of the declaration
1637 /// init-declarator: [C99 6.7]
1638 /// declarator
1639 /// declarator '=' initializer
1640 /// [GNU] declarator simple-asm-expr[opt] attributes[opt]
1641 /// [GNU] declarator simple-asm-expr[opt] attributes[opt] '=' initializer
1642 /// [C++] declarator initializer[opt]
1654 Decl *Parser::ParseDeclarationAfterDeclarator(Declarator &D,
1662 Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
1664 // Inform the current actions module that we just parsed this declarator.
1697 // Parse declarator '=' initializer.
1865 /// specified token is valid after the identifier in a declarator which
1868 /// int x [ 4]; // direct-declarator
1869 /// int x ( int y); // direct-declarator
1870 /// int(int x ) // direct-declarator
1872 /// int x = 17; // init-declarator-list
1873 /// int x , y; // init-declarator-list
1874 /// int x __asm__ ("foo"); // init-declarator-list
1875 /// int x : 4; // struct-declarator
1930 // identifier in the declarator.
2023 // The identifier is followed by a parenthesized declarator.
2079 /// \brief Determine the declaration specifier context from the declarator
2082 /// \param Context the declarator context, which is one of the
2083 /// Declarator::TheContext enumerator values.
2086 if (Context == Declarator::MemberContext)
2088 if (Context == Declarator::FileContext)
2090 if (Context == Declarator::TrailingReturnContext)
2379 // looked at the declarator, and the user probably meant this
2965 /// specifier-qualifier-list struct-declarator-list
2968 /// struct-declarator-list:
2969 /// struct-declarator
2970 /// struct-declarator-list ',' struct-declarator
2971 /// [GNU] struct-declarator-list ',' attributes[opt] struct-declarator
2972 /// struct-declarator:
2973 /// declarator
2974 /// [GNU] declarator attributes[opt]
2975 /// declarator[opt] ':' constant-expression
2976 /// [GNU] declarator[opt] ':' constant-expression attributes[opt]
3011 /// struct-declarator: declarator
3012 /// struct-declarator: declarator[opt] ':' constant-expression
3028 // If attributes exist after the declarator, parse them.
3031 // We're done with this declarator; invoke the callback.
3098 // Install the declarator into the current TagDecl.
3263 // Skip the rest of this declarator, up until the comma or semicolon.
3275 // Skip the rest of this declarator, up until the comma or semicolon.
3425 // Skip the rest of this declarator, up until the comma or semicolon.
3449 // Skip the rest of this declarator, up until the comma or semicolon.
4060 // If this is not a constructor, we must be parsing a declarator,
4195 /// ParseDeclarator - Parse and verify a newly-initialized declarator.
4197 void Parser::ParseDeclarator(Declarator &D) {
4198 /// This implements the 'declarator' production in the C grammar, then checks
4214 /// ParseDeclaratorInternal - Parse a C or C++ declarator. The direct-declarator
4215 /// is parsed by the function passed to it. Pass null, and the direct-declarator
4223 /// declarator: [C99 6.7.5] [C++ 8p4, dcl.decl]
4224 /// [C] pointer[opt] direct-declarator
4225 /// [C++] direct-declarator
4226 /// [C++] ptr-operator declarator
4239 void Parser::ParseDeclaratorInternal(Declarator &D,
4250 bool EnteringContext = D.getContext() == Declarator::FileContext ||
4251 D.getContext() == Declarator::MemberContext;
4257 // The scope spec really belongs to the direct-declarator.
4308 // Recursively parse the declarator.
4329 // the declarator.
4351 // Recursively parse the declarator.
4367 // declarator: reference collapsing will take care of it.
4379 static void diagnoseMisplacedEllipsis(Parser &P, Declarator &D,
4393 /// direct-declarator: [C99 6.7.5]
4395 /// '(' declarator ')'
4396 /// [GNU] '(' attributes declarator ')'
4397 /// [C90] direct-declarator '[' constant-expression[opt] ']'
4398 /// [C99] direct-declarator '[' type-qual-list[opt] assignment-expr[opt] ']'
4399 /// [C99] direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']'
4400 /// [C99] direct-declarator '[' type-qual-list 'static' assignment-expr ']'
4401 /// [C99] direct-declarator '[' type-qual-list[opt] '*' ']'
4402 /// [C++11] direct-declarator '[' constant-expression[opt] ']'
4404 /// direct-declarator '(' parameter-type-list ')'
4405 /// direct-declarator '(' identifier-list[opt] ')'
4406 /// [GNU] direct-declarator '(' parameter-forward-declarations
4408 /// [C++] direct-declarator '(' parameter-declaration-clause ')'
4410 /// [C++11] direct-declarator '(' parameter-declaration-clause ')'
4413 /// [C++] declarator-id
4414 /// [C++11] declarator-id attribute-specifier-seq[opt]
4416 /// declarator-id: [C++ 8]
4433 void Parser::ParseDirectDeclarator(Declarator &D) {
4439 bool EnteringContext = D.getContext() == Declarator::FileContext ||
4440 D.getContext() == Declarator::MemberContext;
4448 // is exited (and the declarator has been parsed).
4456 // abstract-declarator if the type of the parameter names a template
4460 !((D.getContext() == Declarator::PrototypeContext ||
4461 D.getContext() == Declarator::BlockLiteralContext) &&
4475 // The ellipsis can't be followed by a parenthesized declarator. We
4489 (D.getContext() == Declarator::FileContext ||
4490 D.getContext() == Declarator::MemberContext);
4492 AllowConstructorName = (D.getContext() == Declarator::MemberContext);
4503 // whole declarator bad.
4525 // direct-declarator: '(' declarator ')'
4526 // direct-declarator: '(' attributes declarator ')'
4530 // If the declarator was parenthesized, we entered the declarator
4531 // scope when parsing the parenthesized declarator, then exited
4534 // If there was an error parsing parenthesized declarator, declarator
4539 // is exited (and the declarator has been parsed).
4543 // This could be something simple like "int" (in which case the declarator
4544 // portion is empty), if an abstract-declarator is allowed.
4547 // The grammar for abstract-pack-declarator does not allow grouping parens.
4555 if (D.getContext() == Declarator::MemberContext)
4587 // In such a case, check if we actually have a function declarator; if it
4588 // is not, the declarator has been fully parsed.
4591 // The name of the declarator, if any, is tentatively declared within
4612 /// ParseParenDeclarator - We parsed the declarator D up to a paren. This is
4615 /// parameter parens in an abstract-declarator, we call ParseFunctionDeclarator.
4617 /// direct-declarator:
4618 /// '(' declarator ')'
4619 /// [GNU] '(' attributes declarator ')'
4620 /// direct-declarator '(' parameter-type-list ')'
4621 /// direct-declarator '(' identifier-list[opt] ')'
4622 /// [GNU] direct-declarator '(' parameter-forward-declarations
4625 void Parser::ParseParenDeclarator(Declarator &D) {
4632 // declarator paren. If this is a grouping paren, the attribute applies to
4659 // stored, if this is an abstract declarator), then this is probably just
4660 // grouping parens. However, if this could be an abstract-declarator, then
4665 // If this can't be an abstract-declarator, this *must* be a grouping
4682 // direct-declarator: '(' declarator ')'
4683 // direct-declarator: '(' attributes declarator ')'
4707 // argument list. Recognize that this declarator will never have an
4723 /// declarator D up to a paren, which indicates that we are parsing function
4741 void Parser::ParseFunctionDeclarator(Declarator &D,
4775 EndLoc is the end location for the function declarator.
4834 // and the end of the function-definition, member-declarator, or
4835 // declarator.
4839 (D.getContext() == Declarator::MemberContext
4841 : D.getContext() == Declarator::FileContext &&
4918 // float y)", we don't want to start parsing the function declarator as
4919 // though it is a K&R style declarator just because intptr is an
4928 /// ParseFunctionDeclaratorIdentifierList - While parsing a function declarator
4938 Declarator &D,
4940 // If there was no identifier specified for the declarator, either we are in
4941 // an abstract-declarator, or we are in a parameter declarator which was found
4990 /// D is the declarator being parsed. If FirstArgAttrs is non-null, then the
5007 /// declaration-specifiers declarator
5008 /// [C++] declaration-specifiers declarator '=' assignment-expression
5010 /// [GNU] declaration-specifiers declarator attributes
5011 /// declaration-specifiers abstract-declarator[opt]
5012 /// [C++] declaration-specifiers abstract-declarator[opt]
5014 /// [GNU] declaration-specifiers abstract-declarator[opt] attributes
5018 Declarator &D,
5032 // Just use the ParsingDeclaration "scope" of the declarator.
5052 // Parse the declarator. This is "PrototypeContext", because we must
5053 // accept either 'declarator' or 'abstract-declarator' here.
5054 Declarator ParmDecl(DS, Declarator::PrototypeContext);
5077 // Inform the actions module about the parameter declarator, so it gets
5089 if (D.getContext() == Declarator::MemberContext) {
5167 /// [C90] direct-declarator '[' constant-expression[opt] ']'
5168 /// [C99] direct-declarator '[' type-qual-list[opt] assignment-expr[opt] ']'
5169 /// [C99] direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']'
5170 /// [C99] direct-declarator '[' type-qual-list 'static' assignment-expr ']'
5171 /// [C99] direct-declarator '[' type-qual-list[opt] '*' ']'
5172 /// [C++11] direct-declarator '[' constant-expression[opt] ']'
5174 void Parser::ParseBracketDeclarator(Declarator &D) {
5229 // Handle "direct-declarator [ type-qual-list[opt] * ]".