2970. Return type of std::visit misspecified

Section: 23.7.7 [variant.visit] Status: New Submitter: Tim Song Opened: 2017-05-31 Last modified: 2017-07-12

Priority: 2

View all issues with New status.

Discussion:

[variant.visit]/1 correctly uses "type and value category", but then p3 describes the return type of visit to be "the common type of all possible INVOKE expressions of the Effects: element." The type of an expression is never a reference type, due to [expr]/5 removing the referenceness "prior to any further analysis", so this wording as written says that visit always returns a non-reference type, which is presumably not the intent.

[2017-07 Toronto Monday issue prioritization]

Priority 2; Matt to provide wording

Proposed resolution: