[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-22 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG706a4353e87b: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/AST/Expr.cpp:3747 case NPC_ValueDependentIsNull: - if (isTypeDependent() || getType()->isIntegralType(Ctx)) + if ((!containsErrors() && isTypeDependent()) || + getType()->isIntegralType(Ctx))

[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 279715. hokein marked an inline comment as done. hokein added a comment. address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84222/new/ https://reviews.llvm.org/D84222 Files: clang/lib/AST/Expr.cpp

[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-21 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/AST/Expr.cpp:3747 case NPC_ValueDependentIsNull: - if (isTypeDependent() || getType()->isIntegralType(Ctx)) + if ((!containsErr

[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/test/AST/ast-dump-recovery.c:51 + // CHECK-NEXT: `-DeclRefExpr {{.*}} 'some_func' + ptr = some_func(); // should not crash +} For references, the crash stacktrace is like below, the cause is that we run into

[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 279433. hokein marked an inline comment as done. hokein added a comment. dump cast kind. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84222/new/ https://reviews.llvm.org/D84222 Files: clang/lib/AST/Expr.cpp

[PATCH] D84222: [AST][RecoveryExpr] Error-dependent expression should not be treat as a nullptr pointer constant.

2020-07-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If an expression is contains-error and its type is unknown (dependent), we don't treat it as a null pointer constant. Fix a recovery-ast crash on C. Repository: rG LLVM Github Monorepo https: