New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang things lookup is ambiguous, gcc and edg don't #10765
Comments
I tested a variation: namespace mozilla { and both gcc and edg refuse to accept mProxy complaining about a definition with incomplete type. |
one "last" test both gcc and edg accept. It shows that they are merging the declaration and definition: namespace mozilla { |
The relevant bit of code (in SemaDecl.cpp):
This code makes us not treat the second declaration of Proxy as a redeclaration even though lookup finds the previous declaration. Not sure what the right predicate is. |
another testcase: /* g++ accepts this but clang dignoses: namespace A {
|
@llvm/issue-subscribers-clang-frontend Author: None (llvmbot)
| | |
| --- | --- |
| Bugzilla Link | [10393](https://llvm.org/bz10393) |
| Version | unspecified |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@efriedma-quic |
Extended Descriptiongcc and edg accept: namespace mozilla { clang rejects: error: reference to 'Proxy' is ambiguous That code looks really strange, but both gcc and edg accept it. |
Extended Description
gcc and edg accept:
namespace mozilla {
struct Proxy;
}
using mozilla::Proxy;
struct Proxy {
};
Proxy mProxy;
clang rejects:
error: reference to 'Proxy' is ambiguous
That code looks really strange, but both gcc and edg accept it.
The text was updated successfully, but these errors were encountered: