C++ Logo


Advanced search

Re: MSVC issue with name lookup in user-defined deduction guide

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Tue, 22 Jun 2021 21:00:26 +0300
On Tue, 22 Jun 2021 at 20:49, Hani Deek via Std-Discussion
<std-discussion_at_[hidden]> wrote:
> This can seem like a silly bug report only because the code sample I am using is a minimal reproduction and not real life code.
> In my real life code, there was an alias in one of the included headers which accidently happened to have the same name as the deduction guide parameter. The compiler throws a bunch of error messages which are all unrelated to the issue except for one message which says "illegal use of this type as an expression." When you have no clue what is going on, you can't tell which one of the different error messages is the important one, and it can take you hours of debugging until you discover the issue, and you will feel bad at the end when you find out that it was not an error by you but a compiler bug.

Understood, that is indeed a painful problem to solve, especially when
it ends up boiling down to a compiler bug. Very short and especially
single-letter identifiers are always likely to conflict with something
somewhere, and then there's the bad identifiers listed e.g. here:

But yeah, compilers treating the same code in vastly different ways is
just evil. :)

Received on 2021-06-22 13:00:40