Lines Matching defs:scope

50    qualifying scope.  */
58 /* The token's qualifying scope (used when it is a
1073 keeps track of what scope is presently active; everything else
1075 initializers may also need to set the scope, in order to check
1201 scope given by OBJECT_TYPE (the type of `x' or `*x') and also in
1306 /* The scope in which names should be looked up. If NULL_TREE, then
1307 we look up names in the scope that is currently open in the
1309 NAMESPACE_DECL for the scope in which we should look. It can
1310 also be ERROR_MARK, when we've parsed a bogus scope.
1315 will look up `Z' in the scope of `X', rather than the current
1316 scope.) Unfortunately, it is difficult to tell when name lookup
1319 tree scope;
1996 if (parser->scope && parser->scope != global_namespace)
1998 parser->scope, name);
1999 else if (parser->scope == global_namespace)
2011 else if (parser->scope && parser->scope != global_namespace)
2012 error ("%<%D::%D%> %s", parser->scope, name, desired);
2013 else if (parser->scope == global_namespace)
2176 qualifying scope (or NULL, if none) for ID. This function commits
2182 cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id)
2186 old_scope = parser->scope;
2187 parser->scope = scope;
2189 parser->scope = old_scope;
2199 else if (!parser->scope)
2244 /* Here we diagnose qualified-ids where the scope is actually correct,
2246 else if (parser->scope != error_mark_node)
2248 if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
2250 id, parser->scope);
2251 else if (TYPE_P (parser->scope))
2252 error ("%qE in class %qT does not name a type", id, parser->scope);
2283 the scope is dependent, we cannot do much. */
2285 || (parser->scope && TYPE_P (parser->scope)
2286 && dependent_type_p (parser->scope))
2296 cp_parser_diagnose_invalid_type_name (parser, parser->scope, id);
2583 cp_parser_make_typename_type (cp_parser *parser, tree scope, tree id)
2588 result = make_typename_type (scope, id, typename_type,
2591 cp_parser_diagnose_invalid_type_name (parser, scope, id);
2594 return make_typename_type (scope, id, typename_type, tf_error);
3019 at class or namespace scope. */
3200 qualifying scope was dependent. */
3231 of scope `i'. We need to issue a warning message,
3244 (id_expression, decl, parser->scope,
3282 identifier. Sets PARSER->SCOPE to the qualifying scope if there is
3346 saved_scope = parser->scope;
3355 parser->scope = saved_scope;
3361 /* Otherwise, if we are in global scope, then we are looking at one
3479 tree scope;
3499 Here, it is not possible to look up `T' in the scope of `T'
3500 itself. We must look in both the current scope, and the
3501 scope of the containing complete expression.
3517 same scope as we looked up the qualifying name. That idea
3519 scope = parser->scope;
3524 if (scope == error_mark_node)
3530 if (scope && TREE_CODE (scope) == NAMESPACE_DECL)
3533 error ("scope %qT before %<~%> is not a class-name", scope);
3539 gcc_assert (!scope || TYPE_P (scope));
3543 if (scope
3547 && constructor_name_p (token->u.value, scope))
3550 return build_nt (BIT_NOT_EXPR, scope);
3554 in the scope given by the qualification (i.e., S). */
3557 if (scope)
3571 if (!done && scope && qualifying_scope)
3574 parser->scope = qualifying_scope;
3588 /* In "p->S::~T", look in the scope given by "*p" as well. */
3592 parser->scope = object_scope;
3609 parser->scope = NULL_TREE;
3625 if (type_decl == error_mark_node && scope)
3626 return build_nt (BIT_NOT_EXPR, scope);
3630 /* Check that destructor name and scope match. */
3631 if (declarator_p && scope && !check_dtor_name (scope, type_decl))
3635 type_decl, scope);
3703 scope iff there is a nested-name-specifier, or NULL_TREE otherwise.
3747 && TREE_CODE (parser->scope) == TYPENAME_TYPE)
3749 new_scope = resolve_typename_type (parser->scope,
3752 parser->scope = new_scope;
3793 /* Save the old scope since the name lookup we are about to do
3795 old_scope = parser->scope;
3803 && parser->scope
3804 && TREE_CODE (parser->scope) == TYPENAME_TYPE)
3805 parser->scope = resolve_typename_type (parser->scope,
3827 parser->scope = old_scope;
3868 parser->scope = error_mark_node;
3902 /* If it is a class scope, try to complete it; we are about to
3911 /* Make sure we look in the right scope the next time through
3913 parser->scope = new_scope;
3931 token->u.tree_check_value->value = parser->scope;
3944 return success ? parser->scope : NULL_TREE;
3959 tree scope;
3962 scope = cp_parser_nested_name_specifier_opt (parser,
3968 if (!scope)
3971 parser->scope = NULL_TREE;
3974 return scope;
3988 scope.
4005 tree scope;
4011 saved_scope = parser->scope;
4019 scope = cp_parser_class_name (parser,
4029 /* Restore the saved scope. */
4030 parser->scope = saved_scope;
4033 /* If we are not looking at an identifier followed by the scope
4040 scope = cp_parser_namespace_name (parser);
4043 return scope;
4467 /* A call to a static class member, or a namespace-scope
4610 tree scope = NULL_TREE;
4618 parser->scope = NULL_TREE;
4622 /* Enter the scope corresponding to the type of the object
4626 scope = TREE_TYPE (postfix_expression);
4633 scope = non_reference (scope);
4635 if (scope == unknown_type_node)
4638 scope = NULL_TREE;
4641 scope = complete_type_or_else (scope, NULL_TREE);
4644 parser->context->object_type = scope;
4648 if (!scope)
4649 scope = error_mark_node;
4653 if (scope == error_mark_node)
4662 if (scope && SCALAR_TYPE_P (scope))
4702 to a BASELINK; there is no need to include scope information. */
4704 /* But we do need to remember that there was an explicit scope for
4706 if (parser->scope)
4718 if (name != error_mark_node && !BASELINK_P (name) && parser->scope)
4721 parser->scope,
4724 parser->scope = NULL_TREE;
4728 if (scope && name && BASELINK_P (name))
4730 (name, BINFO_TYPE (BASELINK_ACCESS_BINFO (name)), scope);
4737 /* We no longer need to look up names in the scope of the object on
4889 tree* scope,
4927 *scope = TREE_TYPE (cp_parser_type_name (parser));
4929 if (*scope == error_mark_node)
4948 *scope = NULL_TREE;
7028 implicitly in their own scope. In other words, if the statement is
7031 declarations appearing in the dependent statement are out of scope
7033 but ensures that is in its own scope, even if it is not a
7068 have already created a scope. Therefore, even if the dependent
7070 scope. */
7081 don't create a new scope. Do everything else by hand. */
7137 in cp_parser_declaration. (A #pragma at block scope is
7358 done as if we were in the scope of the thing being declared. */
7379 /* In a block scope, a valid declaration must always have a
7905 /* When we parse the conversion-type-id, the current scope will be
7908 saved_scope = parser->scope;
7911 /* We must enter the scope of the class so that the names of
7923 must be in the scope of `S'. */
7928 /* Leave the scope of the class, if any. */
7931 /* Restore the saved scope. */
7932 parser->scope = saved_scope;
9076 && parser->scope && TYPE_P (parser->scope)
9078 && dependent_type_p (parser->scope)
9081 && !constructor_name_p (identifier, parser->scope))
9088 parser->scope, identifier);
9115 But, if the qualifying scope is non-dependent then we can
9118 && (!parser->scope
9119 || (TYPE_P (parser->scope)
9120 && dependent_type_p (parser->scope))))
9163 tree scope = CP_DECL_CONTEXT (get_first_fn (decl));
9164 if (TYPE_P (scope) && dependent_type_p (scope))
9633 implicit C++ linkage scope; exit that scope now. */
9973 if (parser->scope
10108 && !parser->scope)
10232 type = make_typename_type (parser->scope, decl,
10245 parser->scope = NULL_TREE;
10251 && TREE_CODE (parser->scope) != NAMESPACE_DECL)
10252 return cp_parser_make_typename_type (parser, parser->scope,
10255 if (parser->scope)
10294 parser->scope,
10317 the same name already in scope. For example, given:
10323 the global scope; the existing definition is used. However, if
10333 containing scope this declaration names a new type.
10340 either a redeclaration of the name in the current scope or a
10342 introduces the name into the current scope.
10351 `T' is not a new type in the scope of `S'.
10586 /* Look up the identifier in the currently active scope. Look only
10598 During the lookup of a name preceding the :: scope resolution
10602 function if the token after the name is the scope resolution
10781 /* Look for the optional global scope qualification. */
10827 depending on what scope we are in. */
10841 decl = do_class_using_decl (parser->scope, identifier);
11061 this declarator appears in a class scope. The new DECL created by
11093 tree scope;
11141 /* Figure out what scope the entity declared by the DECLARATOR is
11142 located in. `grokdeclarator' sometimes changes the scope, so
11144 scope = get_scope_of_declarator (declarator);
11267 else if (scope)
11270 pushed_scope = push_scope (scope);
11279 are in its scope. If it is a `friend', it may have access to
11530 tree scope = NULL_TREE;
11743 qualifying_scope = parser->scope;
11868 scope = get_scope_of_declarator (declarator);
11869 if (scope)
11871 member are looked up in the containing scope. */
11872 pushed_scope = push_scope (scope);
11894 /* If we entered a scope, we must exit it now. */
11976 if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
11977 error ("%qD is a namespace", parser->scope);
11982 *type = parser->scope;
11984 parser->scope = NULL_TREE;
12074 returned. The first operand is the scope (either a NAMESPACE_DECL
12944 tree scope;
12958 scope = parser->scope;
12959 if (scope == error_mark_node)
12963 in a qualified name where the enclosing scope is type-dependent. */
12964 typename_p = (typename_keyword_p && scope && TYPE_P (scope)
12965 && dependent_type_p (scope));
13003 During the lookup for a name preceding the :: scope
13043 decl = make_typename_type (scope, decl, typename_type,
13064 decl = make_typename_type (scope, decl, tag_type, tf_error);
13097 tree scope = NULL_TREE;
13152 scope = CP_DECL_CONTEXT (TYPE_MAIN_DECL (type));
13153 old_scope = push_inner_scope (scope);
13176 pop_inner_scope (old_scope, scope);
13177 /* If this class is not itself within the scope of another class,
13230 /* Make sure that any template parameters are in scope. */
13387 tree scope;
13389 for (scope = TREE_TYPE (type);
13390 scope && TREE_CODE (scope) != NAMESPACE_DECL;
13391 scope = (TYPE_P (scope)
13392 ? TYPE_CONTEXT (scope)
13393 : DECL_CONTEXT (scope)))
13394 if (TYPE_P (scope)
13395 && CLASS_TYPE_P (scope)
13396 && CLASSTYPE_TEMPLATE_INFO (scope)
13397 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (scope))
13398 && !CLASSTYPE_TEMPLATE_SPECIALIZATION (scope))
13455 tree scope;
13465 /* Figure out in what scope the declaration is being placed. */
13466 scope = current_scope ();
13467 /* If that scope does not contain the scope in which the
13469 if (scope && !is_ancestor (scope, nested_name_specifier))
13472 type, scope, nested_name_specifier);
13482 if (scope == nested_name_specifier)
13550 /* Enter the scope indicated by the nested-name-specifier. */
13595 /* We will have entered the scope containing the class; the names of
13609 /* Leave the scope given by the nested-name-specifier. We will
13610 enter the class scope itself while processing the members. */
13689 /* Accept #pragmas at class scope. */
13989 since the member declaration should be in scope while
14063 parser->scope = NULL_TREE;
14220 parser->scope = NULL_TREE;
14336 class_scope_p = (parser->scope && TYPE_P (parser->scope));
14954 /* Looks up NAME in the current scope, as given by PARSER->SCOPE.
15035 if (parser->scope)
15036 type = parser->scope;
15053 the id-expression was a qualified name, the qualifying scope is
15058 if (parser->scope)
15062 if (parser->scope == error_mark_node)
15068 cannot look up the name if the scope is not a class type; it
15070 dependent_p = (TYPE_P (parser->scope)
15072 && currently_open_class (parser->scope))
15073 && dependent_type_p (parser->scope));
15074 if ((check_dependency || !CLASS_TYPE_P (parser->scope))
15084 type = make_typename_type (parser->scope, name, tag_type,
15092 decl = make_unbound_class_template (parser->scope,
15097 parser->scope, name,
15108 lookup_member, we must enter the scope here. */
15110 pushed_scope = push_scope (parser->scope);
15115 decl = lookup_qualified_name (parser->scope, name,
15121 parser->qualifying_scope = parser->scope;
15127 /* Look up the name in the scope of the OBJECT_TYPE, unless the
15189 check_accessibility_of_qualified_id (decl, object_type, parser->scope);
15237 the scope of the class, then the name lookup automatically
15271 tree scope;
15274 scope = declarator->u.id.qualifying_scope;
15277 while (scope && CLASS_TYPE_P (scope))
15289 if (!CLASSTYPE_TEMPLATE_INFO (scope))
15294 if (explicit_class_specialization_p (scope))
15296 if (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (scope)))
15299 scope = TYPE_CONTEXT (scope);
15382 parser->scope = global_namespace;
15386 return parser->scope;
15390 parser->scope = NULL_TREE;
15412 valid declare a constructor at function scope. */
15497 in the scope of the class. */
15533 /* Leave the scope of the class. */
15550 they must be performed once we are in the scope of the function.
15573 scope of the function to perform the checks, since the function
15729 member template the checks must be performed in the scope of the
15778 implicit C++ linkage scope; exit that scope now. */
15806 appears in a class scope.
15900 parser->scope = NULL_TREE;
16032 saved_scope = parser->scope;
16082 parser->scope = saved_scope;
16113 /* Make sure that any template parameters are in scope. */
16128 /* If this is a local class, enter the scope of the containing
16154 /* Leave the scope of the containing function. */
16190 assumes that the current scope is the scope in which the default
16779 /* Set the scope from the stored value. */
16780 parser->scope = check_value->value;
18962 section-scope:
19045 sections-scope */