Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[dcl.ref]/5 CWG 453: What is a valid object? function? #2304

Copy link
Copy link
Closed
@languagelawyer

Description

@languagelawyer
Issue body actions

[dcl.ref]/5:

A reference shall be initialized to refer to a valid object or function.

Is it an object within its lifetime? Or an object containing a valid value? In a valid state?

[basic.life] says that binding a reference to a virtual base class to a glvalue denoting an object not within its lifetime results in UB. If assume that the list of UBs from using a glvalue denoting an object outside its lifetime is complete, then the conclusion that binding the glvalue to another kind of a reference does not result in UB will follow. And we should conclude that "valid" is not about the lifetime.

Also, according to the style guidelines, "shall" shall be used to put a requirement on a well-formed program. This rule is unlikely to be a diagnosable rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.Issue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.Issue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.