Cross references prefixed with + are to N4861 as edited here. end note]. end note] All declarations for a function shall have equivalent return types, parameter-type-lists, and requires-clauses([temp.over.link]). [Note: An unqualified-id that is not an identifier is used to declare certain functions([class.ctor], [class.conv.fct], [class.dtor], [over.oper], [over.literal]) and for the declaration of template specializations or partial specializations([temp.spec]).
A non-static member function is a virtual function if it is first declared with the keyword virtual or if it overrides a virtual member function declared in a base class (see below). For an object of array or class type, all subobjects of that object are destroyed before any block-scope object variable with static storage duration initialized during the construction of the subobjects is destroyed. The function main shall not be a coroutine([dcl.fct.def.coroutine]). Labels have their own name space and do not interfere with other identifiers. CWG1907 is resolved by forbidding dependence on default (template) arguments not found by lookup for a dependent name. A program thatUpon each transfer of control (including sequential execution of statements) within a function from point P to point Q, all variables that are active at P and not at Q are destroyed in the reverse order of their construction. [Note: A conversion function in a derived class does not hides only a conversion functions in a base classes unless the two functionsthat convert to the same type. Two function types with different language linkages are distinct types even if they are otherwise identical. A using-declaration in a derived class cannot refer to a specialization of a conversion function template in a base class. end note], Otherwise, the object expression shall be of class type.
The allocation functions name is looked up by searching for it in the scope of the promise type. Namespace-scope namesdeclarations exported by a module are visible tocan be found by name lookup in any translation unit importing that module; see ([basic.scope.namespacelookup]). An implementation is not required to diagnose a violation of this rule if neither declaration is reachable from the other. end note] If the using-declarator names a constructor, it declares that the class inherits the named set of constructor declarations introduced by the using-declarator from the nominated base class. A member function of a class X can be a friend of a class Y. end note][]. Richards proposed resolution for missing restriction on private-module-fragment is incorporated. end note], [Note: [basic.lookup.elab] describes how name lookup proceeds for the identifier in aAn elaborated-type-specifier may be used to refer to a previously declared class-name or enum-name even if the name has been hidden by a non-type declaration. end example]. Remove the cross-reference parenthetical in [namespace.def]/4 and update those in [temp.class.spec]/6 and [temp.expl.spec]/3 to refer to [dcl.meaning]. All other namespaces have external linkage. The lookup context of any other qualified name is the type, template, or namespace nominated by the preceding nested-name-specifier. If tThe identifier, whenis looked up([basic.lookup.unqual]), refers to a namespace-name (but not a namespace-alias) that was introduced by searching for it in the scopes of the namespace A in which the named-namespace-definitionD appears or that was introduced in a memberand of every element of the inline namespace set of that namespaceA. [Note: See[expr.prim.id] for restrictions on the use of non-static data members and non-static member functions. [Note: Because the name of a class is inserted in its class scope([class]), the name of a class is also considered a nested member of that class. If the using-declarator does not name a constructor, the unqualified-id is declared in the declarative region in which the using-declaration appears as a synonym for each declaration introduced by the using-declarator. A type or static local variable defined in an inlinethe body of such a function with external or module linkage always refers to the same objectis therefore a single entity. The first parameter shall have type std::size_t([support.types]). There are dozens of Core issues on the subject; the general vagueness of the wording on the subject interferes with resolving them individually.
If a friend declaration D specifies a default argument expression, that declaration shall be a definition and there shall be the onlyno other declaration of the function or function template in the translation unitwhich is reachable from D or from which D is reachable. end note] [Example: nested-name-specifieropt type-name :: ~ type-name. end note] [Example: A qualified name used as the name in a class-or-decltype([class.derived]) or an elaborated-type-specifier is implicitly assumed to name a type, [], A qualified-idqualified or unqualified name is assumedsaid to namebe in a type-only context if it is the terminal name of. end note]. In either case, get is interpreted as a template-id. This website is generated from a git repository.
[]. or -> in a class member access expression([expr.ref]), possibly after a template keyword or ~. [Note: See [temp.expl.spec] and [temp.explicit] for restrictions in explicit specializations and explicit instantiations, respectively.
[Note: If the keyword template is used, the following unqualified name is considered to refer to a template([temp.names]). It applies even for references in expressions that are not potentially-evaluated. [Example: The template parameter list of a member of a class template partial specialization shall match the template parameter list of the class template partial specialization. The storage for these entities lasts until the block in which they are created exits. _end note_], A prospective destructor is introduced by a declaration whose declarator-id ishas an unqualified-id that begins with a ~ declares a prospective destructor; its declarator shall be a function declarator([dcl.fct]) of the form. [Example: declare an overloadeds([over]) functionnamed f() and not simply a single function f() twice. end note]. An explicit specialization does not introduce a name([basic.scope.scope]). Every name that denotes an entity is introduced by a declaration. [Example: Declaration of friends is described in[class.friend], operator functions in[over.oper]. If deallocation function lookup finds more than one usual deallocation function is found, the function to be called is selected as follows: An expression or conversion is in an immediate function context if it is potentially evaluated and its innermost enclosing non-block scope is a function parameter scope of an immediate function. My proposed simplification for Missing associated namespace for member template template arguments? is incorporated on the assumption that the failure to examine the namespace of an associated class is an oversight. The function block scope is neither and has no binding for, The next enclosing scope is the template parameter scope to which the template parameter, While that lookup cant happen yet, the, Because the terminal name(+[expr.prim.id.unqual]/2) of its. AThe name havingof an entity that belongs to a namespace scope([basic.scope.namespace]) has internal linkage if it is the name of, An unnamed namespace or a namespace declared directly or indirectly within an unnamed namespace has internal linkage. Replace the 8 surviving mentions of declarative region (in [basic.def.odr]/9, [expr.prim.id.unqual]/2, and [expr.prim.lambda.capture]/7) with scope. [Note: In a freestanding environment, startup and termination is implementation-defined; startup contains the execution of constructors for non-local objects of namespace scope with static storage duration; termination contains the execution of destructors for objects with static storage duration. [Note: Parameters of a function declared before a default argument are in scope and can hide namespace and class member names. end note]. If that lookup finds nothing, it undergoes unqualified name lookup; in each case, only names that denote types or templates whose specializations are types are considered. [Example: For example, before the construction of a global object that is initialized via a user-provided constructordynamic initialization of an object with static storage duration([class.cdtorbasic.start.dynamic]). Remove subclause, referring the stable name to [diff.basic]. The template argument list of a primary template is the template argument list of its template-head([temp.arg]). [Note: Some of the properties associated with an entity with language linkage are specific to each implementation and are not described here. [Example: A constructor is used to initialize objects of its class type. Class template partial specialization members that are used in a way that requires a definition shall be defined; the definitions of members of the primary template are never used as definitions for members of a class template partial specialization. [Note: If a using-directive refers to a namespace that has already been considered, it does not affect the result. Then, all variables that are active at Q but not at P are initialized in declaration order; unless all such variables have vacuous initialization([basic.life]), the transfer of control shall not be a jumps[] from a point where a variable with automatic storage duration is not in scope to a point where it is in scope is ill-formed unless the variable has vacuous initialization([basic.life]). Remove paragraph 2 (part of whose example is merged into another below): Every using-declaration is a declaration and a member-declaration []. The current class at a program point is the class associated with the innermost class scope containing that point. [Example: Such a function is implicitly an inline([dcl.inline]) function if it is attached to the global module. The incomplete consideration of constraints identified by Barry in Using-declaration with constrained members ([namespace.udecl]/14) is addressed by reusing the general function identity definition. I think the previously-fixed Trac ticket #12228 has regressed. If amultiple function templates is overloadedshare a name, the use of a function template specializationthat name might be ambiguous because template argument deduction([temp.deduct]) may associate the function templateidentify a specialization withfor more than one function template declaration. [][Note: [] end note] The identifier in an enum-head-name is not looked up and is introduced by the enum-specifier or opaque-enum-declaration. If you have something to add or have noticed a mistake, please fork the project on GitHub. [basic.scope] defines the word scope in two different ways, and then implicitly and indirectly specifies many aspects of name lookup with imperfect correspondence to the descriptions in [basic.lookup]. end note] [Example: If a namedeclaration can be reached by several paths through a multiple inheritance graph, the access is that of the path that gives most access. [Note: Each unnamed enumeration with no enumerators is a distinct type. RatherInstead, when the primary template name is used, any previously-declaredreachable partial specializations of the primary template are also considered.
[Example: Replace paragraph 1 (adapting [temp.class.spec]/1): A template-id, that is, the template-name followed by a template-argument-list []. if the for-range-initializer is an expression of class type C, the unqualified-ids and searches in the scope of C([class.member.lookup]) for the names begin and end are looked up in the scope of C as if by class member access lookup([basic.lookup.classref]), and if botheach find at least one declaration, begin-expr and end-expr are range.begin() and range.end(), respectively; otherwise, begin-expr and end-expr are begin(range) and end(range), respectively, where begin and end areundergo argument-dependent looked up in the associated namespaces([basic.lookup.argdep]). InA dependent call is an expression, possibly formed as a non-member candidate for an operator([over.match.oper]), of the form: where the postfix-expression is an unqualified-id, the unqualified-id denotes a dependent name if and, If an operand of an operator is a type-dependent expression, the operator also denotes a dependent name.
A non-static member function is a virtual function if it is first declared with the keyword virtual or if it overrides a virtual member function declared in a base class (see below). For an object of array or class type, all subobjects of that object are destroyed before any block-scope object variable with static storage duration initialized during the construction of the subobjects is destroyed. The function main shall not be a coroutine([dcl.fct.def.coroutine]). Labels have their own name space and do not interfere with other identifiers. CWG1907 is resolved by forbidding dependence on default (template) arguments not found by lookup for a dependent name. A program thatUpon each transfer of control (including sequential execution of statements) within a function from point P to point Q, all variables that are active at P and not at Q are destroyed in the reverse order of their construction. [Note: A conversion function in a derived class does not hides only a conversion functions in a base classes unless the two functionsthat convert to the same type. Two function types with different language linkages are distinct types even if they are otherwise identical. A using-declaration in a derived class cannot refer to a specialization of a conversion function template in a base class. end note], Otherwise, the object expression shall be of class type.
The allocation functions name is looked up by searching for it in the scope of the promise type. Namespace-scope namesdeclarations exported by a module are visible tocan be found by name lookup in any translation unit importing that module; see ([basic.scope.namespacelookup]). An implementation is not required to diagnose a violation of this rule if neither declaration is reachable from the other. end note] If the using-declarator names a constructor, it declares that the class inherits the named set of constructor declarations introduced by the using-declarator from the nominated base class. A member function of a class X can be a friend of a class Y. end note][]. Richards proposed resolution for missing restriction on private-module-fragment is incorporated. end note], [Note: [basic.lookup.elab] describes how name lookup proceeds for the identifier in aAn elaborated-type-specifier may be used to refer to a previously declared class-name or enum-name even if the name has been hidden by a non-type declaration. end example]. Remove the cross-reference parenthetical in [namespace.def]/4 and update those in [temp.class.spec]/6 and [temp.expl.spec]/3 to refer to [dcl.meaning]. All other namespaces have external linkage. The lookup context of any other qualified name is the type, template, or namespace nominated by the preceding nested-name-specifier. If tThe identifier, whenis looked up([basic.lookup.unqual]), refers to a namespace-name (but not a namespace-alias) that was introduced by searching for it in the scopes of the namespace A in which the named-namespace-definitionD appears or that was introduced in a memberand of every element of the inline namespace set of that namespaceA. [Note: See[expr.prim.id] for restrictions on the use of non-static data members and non-static member functions. [Note: Because the name of a class is inserted in its class scope([class]), the name of a class is also considered a nested member of that class. If the using-declarator does not name a constructor, the unqualified-id is declared in the declarative region in which the using-declaration appears as a synonym for each declaration introduced by the using-declarator. A type or static local variable defined in an inlinethe body of such a function with external or module linkage always refers to the same objectis therefore a single entity. The first parameter shall have type std::size_t([support.types]). There are dozens of Core issues on the subject; the general vagueness of the wording on the subject interferes with resolving them individually.
If a friend declaration D specifies a default argument expression, that declaration shall be a definition and there shall be the onlyno other declaration of the function or function template in the translation unitwhich is reachable from D or from which D is reachable. end note] [Example: nested-name-specifieropt type-name :: ~ type-name. end note] [Example: A qualified name used as the name in a class-or-decltype([class.derived]) or an elaborated-type-specifier is implicitly assumed to name a type, [], A qualified-idqualified or unqualified name is assumedsaid to namebe in a type-only context if it is the terminal name of. end note]. In either case, get is interpreted as a template-id. This website is generated from a git repository.
[]. or -> in a class member access expression([expr.ref]), possibly after a template keyword or ~. [Note: See [temp.expl.spec] and [temp.explicit] for restrictions in explicit specializations and explicit instantiations, respectively.
[Note: If the keyword template is used, the following unqualified name is considered to refer to a template([temp.names]). It applies even for references in expressions that are not potentially-evaluated. [Example: The template parameter list of a member of a class template partial specialization shall match the template parameter list of the class template partial specialization. The storage for these entities lasts until the block in which they are created exits. _end note_], A prospective destructor is introduced by a declaration whose declarator-id ishas an unqualified-id that begins with a ~ declares a prospective destructor; its declarator shall be a function declarator([dcl.fct]) of the form. [Example: declare an overloadeds([over]) functionnamed f() and not simply a single function f() twice. end note]. An explicit specialization does not introduce a name([basic.scope.scope]). Every name that denotes an entity is introduced by a declaration. [Example: Declaration of friends is described in[class.friend], operator functions in[over.oper]. If deallocation function lookup finds more than one usual deallocation function is found, the function to be called is selected as follows: An expression or conversion is in an immediate function context if it is potentially evaluated and its innermost enclosing non-block scope is a function parameter scope of an immediate function. My proposed simplification for Missing associated namespace for member template template arguments? is incorporated on the assumption that the failure to examine the namespace of an associated class is an oversight. The function block scope is neither and has no binding for, The next enclosing scope is the template parameter scope to which the template parameter, While that lookup cant happen yet, the, Because the terminal name(+[expr.prim.id.unqual]/2) of its. AThe name havingof an entity that belongs to a namespace scope([basic.scope.namespace]) has internal linkage if it is the name of, An unnamed namespace or a namespace declared directly or indirectly within an unnamed namespace has internal linkage. Replace the 8 surviving mentions of declarative region (in [basic.def.odr]/9, [expr.prim.id.unqual]/2, and [expr.prim.lambda.capture]/7) with scope. [Note: In a freestanding environment, startup and termination is implementation-defined; startup contains the execution of constructors for non-local objects of namespace scope with static storage duration; termination contains the execution of destructors for objects with static storage duration. [Note: Parameters of a function declared before a default argument are in scope and can hide namespace and class member names. end note]. If that lookup finds nothing, it undergoes unqualified name lookup; in each case, only names that denote types or templates whose specializations are types are considered. [Example: For example, before the construction of a global object that is initialized via a user-provided constructordynamic initialization of an object with static storage duration([class.cdtorbasic.start.dynamic]). Remove subclause, referring the stable name to [diff.basic]. The template argument list of a primary template is the template argument list of its template-head([temp.arg]). [Note: Some of the properties associated with an entity with language linkage are specific to each implementation and are not described here. [Example: A constructor is used to initialize objects of its class type. Class template partial specialization members that are used in a way that requires a definition shall be defined; the definitions of members of the primary template are never used as definitions for members of a class template partial specialization. [Note: If a using-directive refers to a namespace that has already been considered, it does not affect the result. Then, all variables that are active at Q but not at P are initialized in declaration order; unless all such variables have vacuous initialization([basic.life]), the transfer of control shall not be a jumps[] from a point where a variable with automatic storage duration is not in scope to a point where it is in scope is ill-formed unless the variable has vacuous initialization([basic.life]). Remove paragraph 2 (part of whose example is merged into another below): Every using-declaration is a declaration and a member-declaration []. The current class at a program point is the class associated with the innermost class scope containing that point. [Example: Such a function is implicitly an inline([dcl.inline]) function if it is attached to the global module. The incomplete consideration of constraints identified by Barry in Using-declaration with constrained members ([namespace.udecl]/14) is addressed by reusing the general function identity definition. I think the previously-fixed Trac ticket #12228 has regressed. If amultiple function templates is overloadedshare a name, the use of a function template specializationthat name might be ambiguous because template argument deduction([temp.deduct]) may associate the function templateidentify a specialization withfor more than one function template declaration. [][Note: [] end note] The identifier in an enum-head-name is not looked up and is introduced by the enum-specifier or opaque-enum-declaration. If you have something to add or have noticed a mistake, please fork the project on GitHub. [basic.scope] defines the word scope in two different ways, and then implicitly and indirectly specifies many aspects of name lookup with imperfect correspondence to the descriptions in [basic.lookup]. end note] [Example: If a namedeclaration can be reached by several paths through a multiple inheritance graph, the access is that of the path that gives most access. [Note: Each unnamed enumeration with no enumerators is a distinct type. RatherInstead, when the primary template name is used, any previously-declaredreachable partial specializations of the primary template are also considered.
[Example: Replace paragraph 1 (adapting [temp.class.spec]/1): A template-id, that is, the template-name followed by a template-argument-list []. if the for-range-initializer is an expression of class type C, the unqualified-ids and searches in the scope of C([class.member.lookup]) for the names begin and end are looked up in the scope of C as if by class member access lookup([basic.lookup.classref]), and if botheach find at least one declaration, begin-expr and end-expr are range.begin() and range.end(), respectively; otherwise, begin-expr and end-expr are begin(range) and end(range), respectively, where begin and end areundergo argument-dependent looked up in the associated namespaces([basic.lookup.argdep]). InA dependent call is an expression, possibly formed as a non-member candidate for an operator([over.match.oper]), of the form: where the postfix-expression is an unqualified-id, the unqualified-id denotes a dependent name if and, If an operand of an operator is a type-dependent expression, the operator also denotes a dependent name.