This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


2493. auto as a conversion-type-id

Section:  []     Status: dup     Submitter: Jim X     Date: 2021-03-10

Given the example,

  struct A{
   operator auto(){
     return 0;
  int main(){
    A a;
    a.operator auto(); // #1
    a.operator int();  // #2

there is implementation divergence regarding which, if either, of the calls is well-formed. MSVC and clang reject #2, g++ rejects #1, and EDG rejects both.

According to [] paragraph 6:

A program that uses a placeholder type in a context not explicitly allowed in [] is ill-formed.

The use of auto as a conversion-type-id in a function call is not mentioned in that section; however, the section is dealing with declarative contexts rather than expressions, so it's not clear how much weight that observation should carry.

Rationale (December, 2021):

This issue is a duplicate of issue 1670.