[PATCH] D13357: [Concepts] Diagnose when 'concept' is specified on a specialization

Faisal Vali via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 15 19:13:14 PDT 2015


faisalv added inline comments.

================
Comment at: include/clang/AST/Decl.h:1577
@@ -1576,2 +1576,3 @@
   bool IsConstexpr : 1;
+  bool IsConcept : 1;
 
----------------
My inclination would have been to add this bit to FunctionTemplateDecl, instead of to every FunctionDecl - since not every kind of FunctionDecl can be a concept ...  My first instinct would have been to add an enum to TemplateKind, and then forward isConcept() to check if we are a template and if so, through it, if concept is specified?  

But I suppose that adds more complexity, and you trade space for speed - For my own edification, could I ask you or Richard to comment on the cons of that approach - and why the current approach is preferred? (i.e. simplicity over complexity or space over time etc.)


http://reviews.llvm.org/D13357





More information about the cfe-commits mailing list