[PATCH] D27486: Correct class-template deprecation behavior

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 09:40:39 PST 2017


aaron.ballman added inline comments.


================
Comment at: include/clang/Basic/Attr.td:301
   bit DuplicatesAllowedWhileMerging = 0;
+  // Set to true if this attribute should apply to template declaration,
+  // remains false if this should only be applied on definition.
----------------
template declaration -> template declarations


================
Comment at: include/clang/Basic/Attr.td:302
+  // Set to true if this attribute should apply to template declaration,
+  // remains false if this should only be applied on definition.
+  bit AppliesToTemplateDeclaration = 0;
----------------
on definition -> to the definition


================
Comment at: include/clang/Sema/Sema.h:7388-7391
+  void InstantiateAttrsForDecl(const MultiLevelTemplateArgumentList &TemplateArgs,
+                        const Decl *Pattern, Decl *Inst,
+                        LateInstantiatedAttrVec *LateAttrs = nullptr,
+                        LocalInstantiationScope *OuterMostScope = nullptr);
----------------
Did clang-format produce this formatting?


================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:320
+    CXXRecordDecl *ThisContext =
+        dyn_cast_or_null<CXXRecordDecl>(ND->getDeclContext());
+    CXXThisScopeRAII ThisScope(*this, ThisContext, /*TypeQuals*/ 0,
----------------
Are you sure `ND` is always non-null? If so, then you should use `cast<>` above instead of `dyn_cast<>`.


================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:2456
+void EmitClangAttrTemplateInstantiateHelper(const std::vector<Record *> &Attrs,
+                                            raw_ostream &OS, bool DeclTime) {
+     OS << "  switch (At->getKind()) {\n";
----------------
What does "time" mean in `DeclTime`?


================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:2507
+}
+// Emits code to instantiate dependent attributes on templates.
+void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) {
----------------
Add a newline above this comment to separate it from the previous function body.


https://reviews.llvm.org/D27486





More information about the cfe-commits mailing list