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

Assertion when two-phase lookup diagnostic finds a declaration of unexpected type #10559

Closed
akyrtzi opened this issue Jun 24, 2011 · 4 comments
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla c++11

Comments

@akyrtzi
Copy link
Contributor

akyrtzi commented Jun 24, 2011

Bugzilla Link 10187
Resolution FIXED
Resolved on Jun 26, 2011 17:26
Version trunk
OS All
CC @DougGregor,@zygoloid

Extended Description

On r133816, the following test case asserts.

template
struct S {
void f() {
for (auto &a : e)
__range(a);
}
T e[10];
};

void g() { S().f(); }

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jun 24, 2011

assigned to @zygoloid

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Jun 25, 2011

There are two components to this failure. The first one can also be reproduced without the range-based for loop, with code such as this:

template void g();
template void f() {
g(T());
}

namespace N { struct S {}; }
void g(N::S);

template void f<N::S>();

This asserts in much the same way as the range-based for example. The issue is that the two-phase name lookup diagnostic is finding names which aren't appropriate for the call, and trying to build calls with them anyway.

The second issue is that the __range variable should not be visible to name lookup.

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Jun 27, 2011

Fixed in r133898.

The issue with __range being visible inside function template instantiations is still present, but should not be detectable to user code at least.

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Nov 27, 2021

mentioned in issue #10340

@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++11
Projects
None yet
Development

No branches or pull requests

1 participant