Open t3nsor opened 1 month ago
"A parameter of type A can be initialized from an argument of type const A"
sounds like the eventual initialization would be possible; what we mean here is "an implicit conversion sequence can be formed", right?
CWG2898
"A parameter of type A can be initialized from an argument of type const A"
sounds like the eventual initialization would be possible; what we mean here is "an implicit conversion sequence can be formed", right?
Good point. Yes, I suppose the text in the example should be amended accordingly.
Updated.
Full name of submitter: Brian Bi
Issue description: [over.best.ics.general]/7 says:
When the argument type is a cv-qualified class type, the following sentence in p6, and its example, appear to imply that the implicit conversion sequence is always the identity conversion:
The meaning of this sentence is unclear. If it applies only to the case where the argument type is the cv-qualified version of the parameter type, then we should say it much more clearly. If it applies to cv-qualified parameter types, then it's meaningless, because parameter types are never cv-qualified. If it applies also to other cases, it is probably wrong.
I believe the example reflects the intent. Clang and GCC agree.
Suggested resolution: Edit [over.best.ics.general]/6 and move its example to paragraph 7:
Edit [over.best.ics.general]/7 and add the example moved from p6, edited further as shown: