You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the declaration at #1, should we say since there is no initializer specified for the object, hence default-initialization is applied?
Specifically, Is there any normative rule in the standard that specifies which declaration the initialization will be applied to?
Except for a note [dcl.init.general.note-10], it seems it's unclear whether the initialization is performed(on a declaration).
Could we change [dcl.init.general] p20 to
A simple-declaration that is definition specifies the initialization of a variable, whether from an explicit initializer or by default-initialization, is called the initializing declaration of that variable.
The modification does not impact member-declarations or parameter declarations, and it can clarify the above example.
The text was updated successfully, but these errors were encountered:
The note that follows shows a situation where the initializing declaration is not a definition.
A declaration that specifies the initialization of a variable, whether from an explicit initializer or by default-
initialization, is called the initializing declaration of that variable.
[Note 10 : In most cases this is the defining declaration (6.2) of the variable, but the initializing declaration of a non-inline static data member (11.4.9.3) can be the declaration within the class definition and not the definition (if any) outside it. — end note]
Maybe we can say that a non-defining declaration can only be an initializing declaration if it has an (explicit) initializer.
If the original [dcl.init.general] p20 intends to cover all declarations of various variables, such as, the parameter declaration that appears in a function-definition, the proposal is not sufficient. In my mind, a parameter-declaration can never be an initializing declaration but in this case, it is a definition. As well as exception-declaration.
For the declaration at
#1
, should we say since there is no initializer specified for the object, hence default-initialization is applied?Specifically, Is there any normative rule in the standard that specifies which declaration the initialization will be applied to?
Except for a note [dcl.init.general.note-10], it seems it's unclear whether the initialization is performed(on a declaration).
Could we change [dcl.init.general] p20 to
The modification does not impact member-declarations or parameter declarations, and it can clarify the above example.
The text was updated successfully, but these errors were encountered: