[PATCH] D27486: Correct class-template deprecation behavior
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 4 10:05:34 PST 2017
erichkeane marked 6 inline comments as done.
erichkeane added a comment.
All Aaron's comments addressed in a patch that is on its way!
================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:320
+ CXXRecordDecl *ThisContext =
+ dyn_cast_or_null<CXXRecordDecl>(ND->getDeclContext());
+ CXXThisScopeRAII ThisScope(*this, ThisContext, /*TypeQuals*/ 0,
----------------
aaron.ballman wrote:
> Are you sure `ND` is always non-null? If so, then you should use `cast<>` above instead of `dyn_cast<>`.
I hadn't thought much about it actually, this is from a section in InstantiateAttrs (see 410 in this file). Also reinspecting, it seems that ND can be moved above the for-loop as well, so I'm going to do that, so that we can perhaps save the attributes in that case.
================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:2456
+void EmitClangAttrTemplateInstantiateHelper(const std::vector<Record *> &Attrs,
+ raw_ostream &OS, bool DeclTime) {
+ OS << " switch (At->getKind()) {\n";
----------------
aaron.ballman wrote:
> What does "time" mean in `DeclTime`?
Right, good point. I'll choose a better name in the next patch.
https://reviews.llvm.org/D27486
More information about the cfe-commits
mailing list