Skip to content

[class.conv.fct] Conversion function templates with deduced return type #804

@eisenwave

Description

@eisenwave

Full name of submitter: Brian Bi

Reference (section label): [class.conv.fct]

See also cplusplus/draft#8490 for discussion.

Issue description

Following CWG1670, the ban of conversion function templates with deduced return type in [class.conv.fct] paragraph 8 has become redundant, except that removing this paragraph would make such uses of placeholder type specifiers IFNDR, not ill-formed.

Suggested resolution

Delete [class.conv.fct] paragraph 8:

-A conversion function template shall not have a deduced return type ([dcl.spec.auto]).
-[Example:
-struct S {
-  operator auto() const { return 10; }      // OK
-  template<class T>
-  operator auto() const { return 1.2; }     // error: conversion function template
-};
-— end example]

Change [dcl.spec.auto.general] paragraph 4 as follows: SUPERSEDED, SEE BELOW

 A placeholder type can appear in
 the decl-specifier-seq or type-specifier-seq
 in the declared return type of a function declarator
 that declares
+either
 a function other than a conversion function\iref{class.conv.fct}
+or a conversion function template
 ;
 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions