[Bug c++/103110] templated operator auto is ignored

2021-11-06 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110 --- Comment #6 from Fedor Chelnokov --- Thanks for the explanation! I reported Clang bug: https://bugs.llvm.org/show_bug.cgi?id=52434

[Bug c++/103110] templated operator auto is ignored

2021-11-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110 --- Comment #5 from Andrew Pinski --- (In reply to Fedor Chelnokov from comment #4) > Actually you changed the example, and if T is void, then T{} is ill-formed. > But I do not see how it relates to the original program. I know I changed the ex

[Bug c++/103110] templated operator auto is ignored

2021-11-06 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110 --- Comment #4 from Fedor Chelnokov --- Actually you changed the example, and if T is void, then T{} is ill-formed. But I do not see how it relates to the original program.

[Bug c++/103110] templated operator auto is ignored

2021-11-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/103110] templated operator auto is ignored

2021-11-06 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110 --- Comment #2 from Fedor Chelnokov --- I think the program must be equivalent to ``` struct S { operator auto() const { return 2; } }; int main() { S s; [[maybe_unused]] int d = s; } ``` and `auto` here is deduced from `return 2` a

[Bug c++/103110] templated operator auto is ignored

2021-11-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110 --- Comment #1 from Andrew Pinski --- I think this is a bug in clang as GCC, ICC (EDG) and MSVC all reject the code for the same reason. GCC even warns about it: :3:14: warning: use of 'auto' in member template conversion operator can never be d