Re: Namespace vs. class ambiguity: three compilers - three different outcomes

Liste des GroupesRevenir à cl c++ 
Sujet : Re: Namespace vs. class ambiguity: three compilers - three different outcomes
De : andreytarasevich (at) *nospam* hotmail.com (Andrey Tarasevich)
Groupes : comp.lang.c++
Date : 10. Sep 2024, 05:27:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbohrv$2p7p2$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 09/07/24 11:24 AM, Andrey Tarasevich wrote:
 Clang issues an error: it complains about the call being ambiguous. I.e. the error is issued at the point of the call.
 MSVC++ issues an error for `using X::N;` at the point of using-declaration: it basically says that `N` already exists in this scope. But if we switch to `using namespace X;` version, MSVC++ will exhibit Clang-like behavior: complain about ambiguity at the point of the call.
More precisely, it is not the call that's ambiguous. These compilers do not even get to the call itself. They complain about the ambiguity of `N` and just stop there. Which means that trying to "resolve" this ambiguity by renaming one of the functions is not going to make any difference.
GCC also "resolves" at the `N` stage. It just ignores the class entirely.
--
Best regards,
Andrey

Date Sujet#  Auteur
7 Sep 24 * Namespace vs. class ambiguity: three compilers - three different outcomes4Andrey Tarasevich
7 Sep 24 +* Re: Namespace vs. class ambiguity: three compilers - three different outcomes2Bonita Montero
10 Sep 24 i`- Re: Namespace vs. class ambiguity: three compilers - three different outcomes1Andrey Tarasevich
10 Sep 24 `- Re: Namespace vs. class ambiguity: three compilers - three different outcomes1Andrey Tarasevich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal