hubert.reinterpretcast added inline comments.

================
Comment at: include/clang/AST/DeclTemplate.h:373-391
+class TemplateDeclWithACBase {
+protected:
+  TemplateDeclWithACBase() = default;
+
+  ConstrainedTemplateDeclInfo CTDInfo;
+};
+
----------------
rsmith wrote:
> This mechanism seems unnecessary to me; allocating the 
> `ConstrainedTemplateDeclInfo` separately seems a lot simpler. Forcing this 
> and the template into a single allocation is unlikely to help anything since 
> we use a slab allocator (which is going to lay the objects out the same way 
> this template trick does, unless we hit the end of a slab).
Okay; I'll probably allocate separately in the `Create` function.


================
Comment at: lib/Sema/SemaTemplate.cpp:1178
+      if (!(CurAC || PrevAC))
+        return false; // nothing to check
+      if (CurAC && PrevAC) {
----------------
rsmith wrote:
> [nit] Comments should be full sentences: capitalized and ending in a period.
Okay.


================
Comment at: lib/Sema/SemaTemplate.cpp:1299-1300
 
+  // Attach the associated constraints when the declaration will not be part of
+  // a decl chain
+  Expr *const ACtoAttach =
----------------
rsmith wrote:
> Is there a reason you don't want to store the associated constraints that 
> were specified on a redeclaration? I'd expect that to hurt tools that want 
> source fidelity (for instance, a renaming tool will want to be able to find 
> all the references to a particular name, even in a //requires-clause// on a 
> redeclaration of a template).
Associated constraints are not part of the source fidelity: the requires-clause 
on the template-parameter-list is (and later, if constraints are introduced by 
abbreviated function call syntax, etc., the function parameter list).


https://reviews.llvm.org/D25674



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to