[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9fb7e98db5aa: [AST] Fix a crash on accessing a class without definition in constexpr function… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the review! Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), rsmith wrote: > hokein wrote: > > rsmith

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 273281. hokein marked 5 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80981/new/ https://reviews.llvm.org/D80981 Files:

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith marked an inline comment as done. rsmith added a comment. This revision is now accepted and ready to land. Minor suggestions but this LGTM. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), rsmith wrote: > hokein wrote: > > rsmith wrote: > > > hokein

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 272018. hokein marked an inline comment as done. hokein added a comment. Update per Richard's comment: do the error check in getDefaultInitValue, and modify every caller of it to support the error handling. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 272019. hokein added a comment. cleanup the debug code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80981/new/ https://reviews.llvm.org/D80981 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-18 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), hokein wrote: > rsmith wrote: > > hokein wrote: > > > sammccall

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), rsmith wrote: > hokein

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-15 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), hokein wrote: > sammccall wrote: > > This doesn't look all that

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a subscriber: rsmith. hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(),

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), This doesn't look all that safe - you're using a `None` value

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D80981 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/constant-expression-cxx2a.cpp Index: