Change the grammar in 8.3.5 dcl.fct paragraph 3:
Change in 8.3.6 dcl.fct.default paragraph 1:parameter-declaration: attribute-specifieropt decl-specifier-seq declarator attribute-specifieropt decl-specifier-seq declarator = initializer-clauseassignment-expressionattribute-specifieropt decl-specifier-seq abstract-declaratoropt attribute-specifieropt decl-specifier-seq abstract-declaratoropt = initializer-clauseassignment-expression
If anChange in 8.3.6 dcl.fct.default paragraph 3:expressioninitializer-clause is specified in aparameter declarationparameter-declaration thisexpressioninitializer-clause is used as a default argument. Default arguments will be used in calls where trailing arguments are missing.
A default argumentChange in 8.3.6 dcl.fct.default paragraph 5:expressionshall be specified only in the parameter-declaration-clause of a function declaration or in a template-parameter (14.1 temp.param); in the latter case, the initializer-clause shall be an assignment-expression.ItA default argument shall not be specified for a parameter pack. ...
A default argumentChange in 8.3.6 dcl.fct.default paragraph 7:expressionis implicitly converted (Clause 4 conv) to the parameter type. The default argumentexpressionhas the same semantic constraints as the initializerexpressionin a declaration of a variable of the parameter type, using the copy-initialization semantics (8.5 dcl.init). The names in the default argumentexpressionare bound, and the semantic constraints are checked, at the point where the default argumentexpressionappears. Name lookup and checking of semantic constraints for default arguments in function templates and in member functions of class templates are performed as described in 14.7.1 temp.inst. [ Example: ... ] [ Note: in member function declarations, names in default argumentsargument expressionsare looked up as described in 3.4.1 basic.lookup.unqual. Access checking applies to names in default argumentsargument expressionsas described in Clause 11 class.access. -- end note ]
Local variables shall not be used in a default argumentChange in 8.3.6 dcl.fct.default paragraph 9:expressions. [ Example: ... ]
... Consequently, parameters of a function shall not be used in a default argumentChange 1.9 intro.execution paragraph 11:expressions, even if they are not evaluated. Parameters of a function declared before a default argumentexpressionare in scope and can hide namespace and class member names. [ Example: ... ] Similarly, a non-static member shall not be used in a default argumentexpression, even if it is not evaluated, unless it appears as the id-expression of a class member access expression (5.2.5 expr.ref) or unless it is used to form a pointer to member (5.3.1 expr.unary.op). [ Example: ... ]
[ Note: the evaluation of a full-expression can include the evaluation of subexpressions that are not lexically part of the full-expression. For example, subexpressions involved in evaluating default argumentsChange in 3.4.1 basic.lookup.unqual paragraph 6:argument expressions(8.3.6 dcl.fct.default) are considered to be created in the expression that calls the function, not the expression that defines the default argument. -- end note ]
A name used in the definition of a function following the function's declarator-id [ Footnote: This refers to unqualified names that occur, for instance, in a type or default argumentChange in 3.4.1 basic.lookup.unqual paragraph 8:expressionin the parameter-declaration-clause or used in the function body. ] that is a member of namespace N (where, only for the purpose of exposition, N could represent the global scope) shall be declared before its use in the block in which it is used or in one of its enclosing blocks (6.3 stmt.block) or, shall be declared before its use in namespace N or, if N is a nested namespace, shall be declared before its use in one of N's enclosing namespaces. [ Example: ... ]
A name used in the definition of a member function (9.3 class.mfct) of class X following the function's declarator-id [ Footnote: That is, an unqualified name that occurs, for instance, in a type or default argumentChange in 7.1.2 dcl.fct.spec paragraph 4:expressionin the parameter-declaration-clause or in the function body. ] or in the brace-or-equal-initializer of a non-static data member (9.2 class.mem) of class X shall be declared in one of the following ways: ...
... [ Note: A string literal appearing in a default argumentChange in 8.5 dcl.init paragraph 3:expressionis not in the body of an inline function merely because the expression is used in a function call from that inline function. -- end note ] ...
[ Note: default argumentsChange in 11 class.access paragraph 8:argument expressionsare more restricted; see 8.3.6 dcl.fct.default.
The names in a default argumentChange in 12.2 class.temporary paragraph 4:expression(8.3.6 dcl.fct.default) are bound at the point of declaration, and access is checked at that point rather than at any points of use of the default argumentexpression. ...
If the constructor has one or more default arguments, the destruction of every temporary created in a default argumentexpressionis sequenced before the construction of the next array element, if any.
Change in 14.7.1 temp.inst paragraph 11:
If a function templatef
is called in a way that requires a default argumentexpressionto be used, the dependent names are looked up, the semantics constraints are checked, and the instantiation of any template used in the default argumentexpressionis done as if the default argumentexpressionhad been anexpressioninitializer used in a function template specialization with the same scope, the same template parameters and the same access as that of the function templatef
used at that point. ...