[clang][AST] Propagate the value-dependent bit for VAArgExpr.
authorHaojian Wu <hokein.wu@gmail.com>
Fri, 19 May 2023 10:00:38 +0000 (12:00 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Fri, 19 May 2023 21:43:46 +0000 (23:43 +0200)
commitd4e935240f0223cdf2270dde587960d3d3868c6f
tree7edd1071f8439e066c2b60ed85fb1688c53a7408
parenta268127736e4d703cef8c9f4841f9a8e8ac21ba7
[clang][AST] Propagate the value-dependent bit for VAArgExpr.

Fixes https://github.com/llvm/llvm-project/issues/62711

We never set the value-dependent bit for the VAArgExpr before this
patch, this was fine becase the dependent-type TypoExpr was always
resolved before checking the operands (see https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaExpr.cpp#L21173-L21180)

Now we have enabled the dependence by default for C, the typo expr is
not early resolved before checking rather than delayed (share the same
codepath with C++).

The fix is to propagate the value-dependent bit for VAArgExpr where it contains
a TypoExpr, so that the AST node can be handled properly.

Differential Revision: https://reviews.llvm.org/D150955
clang/docs/ReleaseNotes.rst
clang/lib/AST/ComputeDependence.cpp
clang/test/AST/ast-dump-recovery.c