Files
clang-p2996/clang/test/SemaCXX/using-decl-templates.cpp
Zhouyi Zhou b84fd822fa Add boundary check for ASTUnresolvedSet::erase
When compile following code with clang (Debug build), Assertion will be triggered.

```
struct A
{
        struct Nested {};
        operator Nested*() {return 0;};
};

struct B : A
{
        using A::operator typename A::Nested*;
        operator typename A::Nested *() {
                struct A * thi = this;
                return *thi;
        };
};
```

The assertion fail is caused by: `void erase(unsigned I) { Decls[I] = Decls.pop_back_val(); }` when size of `Decls` is 1 before erase.

Reviewed By: rjmccall, MaskRay

Differential Revision: https://reviews.llvm.org/D137263
2022-11-06 15:07:42 -08:00

3.1 KiB