https://bugs.llvm.org/show_bug.cgi?id=52434

            Bug ID: 52434
           Summary: A conversion function template shall not have a
                    deduced return type
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: fchelno...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

This code is invalid:
```
struct S {
    template<class=void>
    operator auto() const { return 2; }
};

int main() {
    S s;
    [[maybe_unused]] int d = s;
}
```
because the standard explicitly prohibits conversion function template having a
deduced return type:
https://timsong-cpp.github.io/cppwp/n4861/class.conv.fct#6

But now Clang accepts the program:
https://gcc.godbolt.org/z/rMK4zboEd
which is a bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to