[clang] Implement divergence for TypedefType and UsingType
authorMatheus Izvekov <mizvekov@gmail.com>
Sun, 4 Sep 2022 02:45:40 +0000 (04:45 +0200)
committerMatheus Izvekov <mizvekov@gmail.com>
Mon, 3 Oct 2022 21:23:58 +0000 (23:23 +0200)
commit69a6417406a1b0316a1fa6aeb63339d0e1d2abbd
tree72e8242cccf815b289f7fad153c9d432991910e2
parenteda6ff347272f52e1344d43d956e383a1c039155
[clang] Implement divergence for TypedefType and UsingType

With this patch, TypedefTypes and UsingTypes can have an
underlying type which diverges from their corresponding
declarations.

For the TypedefType case, this can be seen when getting
the common sugared type between two redeclarations with
different sugar.

For both cases, this will become important as resugaring
is implemented, as this will allow us to resugar these
when they were dependent before instantiation.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D133468
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/JSONNodeDumper.h
clang/include/clang/AST/Type.h
clang/include/clang/AST/TypeProperties.td
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/ASTStructuralEquivalence.cpp
clang/lib/AST/JSONNodeDumper.cpp
clang/lib/AST/TextNodeDumper.cpp
clang/lib/AST/Type.cpp
clang/test/SemaCXX/sugar-common-types.cpp