[PATCH] D98664: Fix crash on dumping AST containing constant initializer with ParenListExpr
Aaron Puchert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 15 15:35:38 PDT 2021
aaronpuchert created this revision.
aaronpuchert added reviewers: aaron.ballman, riccibruno, rsmith.
Herald added a subscriber: kristof.beyls.
aaronpuchert requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
The crash was introduced by D83183 <https://reviews.llvm.org/D83183> (f63e3ea558bb <https://reviews.llvm.org/rGf63e3ea558bbe14826b5b775367eac617b35e041>) as far as I can tell.
The problem is that ParenListExprs have a <NULL TYPE> which the
expression evaluation, specifically Expr::EvaluateAsInitializer,
couldn't deal with. One solution would have been to make the evaluation
logic capable of dealing with NULL TYPE, but I rather decided to
harmonize ParenListExprs with InitListExprs, which always have a void
type by default.
Actually I think that the dependent type would not be a bad fit here:
although the type of the contained expression might not be dependent,
the type of the expression itself might be. But this seems like a bigger
change, the assumption that InitListExprs have void type seems to be
baked into quite a few places.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98664
Files:
clang/include/clang/AST/Expr.h
clang/lib/AST/Expr.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/AST/ast-dump-expr-json.cpp
clang/test/AST/ast-dump-expr.cpp
clang/test/AST/ast-dump-lambda.cpp
clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
clang/test/AST/ast-dump-recovery.cpp
clang/test/AST/ast-dump-templates.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98664.330828.patch
Type: text/x-patch
Size: 12842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210315/9b0bc5e5/attachment-0001.bin>
More information about the cfe-commits
mailing list