[clang][AST] TextNodeDumper should not evaluate the initializer of constexpr variable...
authorTakuya Shimizu <shimizu2486@gmail.com>
Mon, 22 May 2023 15:29:20 +0000 (00:29 +0900)
committerTakuya Shimizu <shimizu2486@gmail.com>
Mon, 22 May 2023 15:57:38 +0000 (00:57 +0900)
commit986cbd80d1dc838c61abff24b8d7ac28dcf4ac2a
tree5eddf8bc4144bebac7335526f2c866acea962b1b
parent6b50e87f21e131fb75d234acaa69b2386e3b6006
[clang][AST] TextNodeDumper should not evaluate the initializer of constexpr variable declaration when it has a dependent type

`TextNodeDumper` enabed through `-ast-dump` flag should not evlauate the initializer when it visits a constexpr `VarDecl` node if it has a dependent type.

I found a crashing case fixed by this change and added it as a test case.
`template <typename T> constexpr T call_init(0);`
Link: https://godbolt.org/z/3bG9Pjj5E
This is a fix for the regression caused by D146358

Differential Revision: https://reviews.llvm.org/D151033
clang/docs/ReleaseNotes.rst
clang/lib/AST/TextNodeDumper.cpp
clang/test/AST/ast-dump-decl.cpp