[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-01-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes `APValue::LValueBase::LValueBase` constructs `ValueDecl` with its canonicalDecl, even though it's invalid. And when obtain its type, it also check all redecls and ignore checking if it's valid. This will cause

[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-01-12 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/77893 `APValue::LValueBase::LValueBase` constructs `ValueDecl` with its canonicalDecl, even though it's invalid. And when obtain its type, it also check all redecls and ignore checking if it's valid. This will cause