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
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
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.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103110
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
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
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