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 does not properly resolve classname::classname as constructor #13775
Comments
*** Bug llvm/llvm-bugzilla-archive#15243 has been marked as a duplicate of this bug. *** |
*** Bug llvm/llvm-bugzilla-archive#23254 has been marked as a duplicate of this bug. *** |
This bug is also a rejects-valid, as in https://llvm.org/bugs/show_bug.cgi?id=8263 |
*** Bug #8635 has been marked as a duplicate of this bug. *** |
Fixed for Clang 5 in r292518. |
mentioned in issue llvm/llvm-bugzilla-archive#15243 |
mentioned in issue llvm/llvm-bugzilla-archive#23254 |
mentioned in issue #8635 |
Extended Description
Given the following:
struct A {
A() {}
A(int) {}
};
int main() {
int i;
{
A::A(i); // <---
}
}
Clang parses the marked line as a variable declaration:
ConsoleApplication1.cpp:9:13: warning: declaration shadows a local variable [-Wshadow]
A::A(i); // <---
^
This is due to clang parsing A::A as a reference to the injected class name instead of as an illegal reference to A's constructor.
Related bugs: 8263 8236
Related email thread:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-July/022867.html
The text was updated successfully, but these errors were encountered: