diff options
author | Vladislav Belov <vladislav.belov@syntacore.com> | 2024-11-26 14:56:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-26 12:56:46 +0100 |
commit | 486644723038555a224fd09d462bb5099e64809e (patch) | |
tree | 64aad1f60eeb056f228ae84c6e0f5baf6c0882ec /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 4a7b56e6e7dd0f83c379ad06b6e81450bc691ba6 (diff) | |
download | llvm-486644723038555a224fd09d462bb5099e64809e.zip llvm-486644723038555a224fd09d462bb5099e64809e.tar.gz llvm-486644723038555a224fd09d462bb5099e64809e.tar.bz2 |
[Clang] Fix name lookup for dependent bases (#114978)
Currently the following example is a compilation failure:
```cpp
template<typename T> struct A {
typedef int M;
struct B {
typedef void M;
struct C;
};
};
template<typename T> struct A<T>::B::C : A<T> {
M m; // void or int ?
};
```
According to the point 13.8.3.2
```
A dependent base class is a base class that is a dependent type and is not the current instantiation.
Note 2 : A base class can be the current instantiation in the case of a nested class naming an enclosing class as a base.
```
The base class `A` is the current instantiation, because `C` is a nested
class for an enclosing class `A<T>`, it's is the not-dependent base
class and we need to search the names through its scope.
This patch makes this example compile
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
0 files changed, 0 insertions, 0 deletions