[clang] Add the check of membership in decltype for the issue #58674
authorLiming Liu <gangliugangliu.ml@outlook.com>
Tue, 10 Jan 2023 12:28:52 +0000 (20:28 +0800)
committerLiming Liu <gangliugangliu.ml@outlook.com>
Sun, 29 Jan 2023 05:44:19 +0000 (13:44 +0800)
commit01adf96ebc8608bcdda0cacc303035b2e60ccb46
tree1753ee200cf7b61cfd2f1285a04e127d3220d074
parent2667be0eb85b65f95d5cf303162219d067de11ae
[clang] Add the check of membership in decltype for the issue #58674

D137531 had once fixed the issue. However, it caused a crash during compiling
llvm/unittests/IR/PatternMatch.cpp in stage-2. The reason is the predicator
isDerivedFrom does not consider independent types if the derived type is
dependent.

This patch improves D137531 by adding an option to make isDerivedFrom consider
independent types.

Differential Revision: https://reviews.llvm.org/D142437
clang/docs/ReleaseNotes.rst
clang/include/clang/AST/DeclCXX.h
clang/lib/AST/CXXInheritance.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/SemaCXX/decltype.cpp