Skip to content
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

Closed
llvmbot opened this issue Jul 19, 2012 · 8 comments
Closed

Clang does not properly resolve classname::classname as constructor #13775

llvmbot opened this issue Jul 19, 2012 · 8 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 19, 2012

Bugzilla Link 13403
Resolution FIXED
Resolved on Jan 19, 2017 15:00
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid,@RealLitb

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

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Apr 17, 2015

*** Bug llvm/llvm-bugzilla-archive#15243 has been marked as a duplicate of this bug. ***

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Apr 17, 2015

*** Bug llvm/llvm-bugzilla-archive#23254 has been marked as a duplicate of this bug. ***

@RealLitb
Copy link
Mannequin

RealLitb mannequin commented Aug 14, 2015

This bug is also a rejects-valid, as in https://llvm.org/bugs/show_bug.cgi?id=8263

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Jan 18, 2017

*** Bug #8635 has been marked as a duplicate of this bug. ***

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Jan 19, 2017

Fixed for Clang 5 in r292518.

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#15243

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#23254

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Nov 27, 2021

mentioned in issue #8635

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

1 participant