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
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
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
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
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