[PATCH] D62116: [Sema] raise nullptr check to cover additional uses

2019-05-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:557-558 +dyn_cast_or_null(ND->getDeclContext()); +CXXThisScopeRAII ThisScope(*this, ThisContext, Qualifiers(), + ND->isCXXInstan

[PATCH] D62116: [Sema] raise nullptr check to cover additional uses

2019-05-19 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith requested changes to this revision. rsmith added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:557-558 +dyn_cast_or_null(ND->getDeclContext()); +CXXThisScopeRAII ThisScope(*thi

[PATCH] D62116: [Sema] raise nullptr check to cover additional uses

2019-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. A similar case exists and was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No. 16" (see under #13), `clang/lib/Sema/SemaTemplateInstantiate.cpp` `Sema::InstantiateClass()`. I'll wait for feedback on this patch, then either roll up the additional

[PATCH] D62116: [Sema] raise nullptr check to cover additional uses

2019-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Note that this changes when the destructor for `CXXThisScopeRAII` runs. It's not clear to me why `ThisScope` is constructed at all. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62116/new/ https://reviews.llvm.org

[PATCH] D62116: [Sema] raise nullptr check to cover additional uses

2019-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision. nickdesaulniers added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No. 14" (see under #13). It looks like PVS studio flags nullptr checks where