-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
"Unable to find instantiation of declaration!", UNREACHABLE executed at SemaTemplateInstantiateDecl.cpp:4616 #21483
Comments
No description provided. |
Still crashing as of post-17 trunk: https://godbolt.org/z/9dfzWd8qh struct bidirectional_iterator {};
template <typename I>
struct counted_cursor {
struct mixin {
friend void advance(counted_cursor<I>::mixin it) {
it.mixin::type;
}
};
};
int main() {
advance(counted_cursor<bidirectional_iterator>::mixin{});
} Trunk crash:
|
@llvm/issue-subscribers-clang-frontend
| | |
| --- | --- |
| Bugzilla Link | [21109](https://llvm.org/bz21109) |
| Version | trunk |
| OS | Windows NT |
| Attachments | [auto-generated repro](https://user-images.githubusercontent.com/60944935/143750119-75c271ab-c954-4a3b-b696-5c80dee9c0d1.gz) |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor |
Extended DescriptionStack dump:
clang: error: unable to execute command: Aborted |
So in this case: https://godbolt.org/z/7Pra5jG1E struct bidirectional_iterator {};
template <typename I>
struct counted_cursor {
struct mixin {
friend void advance(mixin it) {
it.type;
}
};
};
int main() {
advance(counted_cursor<bidirectional_iterator>::mixin{});
} we obtain a diagnostic, so something about the qualified name is preventing us from diagnosing this, I think. There are a bunch of places we diagnose |
Actually this may be a better example: https://godbolt.org/z/TxnWYfozr because it looks like we are crashing in the lookup for struct bidirectional_iterator {};
template <typename I>
struct counted_cursor {
struct mixin {
friend void advance(mixin it) {
it.mixin;
}
};
};
int main() {
advance(counted_cursor<bidirectional_iterator>::mixin{});
} but it looks like that diagnostic is also happening in |
In the case with just llvm-project/clang/lib/Sema/TreeTransform.h Lines 13766 to 13771 in a866ce7
|
I think the unreachable here: llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Lines 6343 to 6344 in 347b3f1
is not correct. If we let the control flow through then we get a reasonable diagnostic: qualLookNotExist2.cpp:7:17: error: no member named 'type' in 'counted_cursor<bidirectional_iterator>::mixin'
7 | it.mixin::type;
| ~~ ^
qualLookNotExist2.cpp:13:3: note: in instantiation of member function 'advance' requested here
13 | advance(counted_cursor<bidirectional_iterator>::mixin{});
| ^
CC @zygoloid wdyt? |
My last two examples no longer crash on trunk but the original one does. |
It is not only a assert crash issue. This code is valid in gcc but invalid in clang struct bidirectional_iterator {};
template <typename I>
struct counted_cursor {
struct mixin {
int type;
friend void advance(counted_cursor<I>::mixin it) {
it.mixin::type;
}
};
};
int main() {
advance(counted_cursor<bidirectional_iterator>::mixin{});
} |
Extended Description
Stack dump:
The text was updated successfully, but these errors were encountered: