Open
Description
Bugzilla Link | 47684 |
Version | unspecified |
OS | All |
CC | @DougGregor,@zygoloid |
Extended Description
Testcase causes a broken AST and a crash in IR generation:
struct A {
void f();
};
template<typename T> struct B : A {
using A::f;
static constexpr auto p = &B::f;
void f();
};
auto v = B<int>::p;
The problem is that we inject a using shadow declaration for 'using A::f', and then try to retroactively remove it (after it was already used) when we see the later declaration of the member 'void f()'. Then during template instantiation, we don't instantiate the using-shadow declaration (it was already removed), so the '&B::f' has nothing to refer to.
Perhaps the best thing to do would be to reject any case where the UsingShadowDecl is referenced before being hidden (on the basis that this is a "reordering the declarations changes the meaning of the class" case).
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
wheatman commentedon Jul 15, 2023
This still crashes on post 16 trunk(ba7cc56)
https://godbolt.org/z/nTGdTG3o1
It compiles fine with gcc 13.1
The crash gives the message
The full dump is
llvmbot commentedon Jul 15, 2023
@llvm/issue-subscribers-clang-codegen