[PATCH] D45131: [AST] Refactor UnaryTransformType into TransformTraitType supporting non-unary transforms

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 4 21:31:14 PDT 2018


EricWF marked 4 inline comments as done.
EricWF added inline comments.


================
Comment at: lib/Parse/ParseDeclCXX.cpp:1077-1087
+  auto DiagSelect = [&]() -> Optional<DiagInfo> {
+    if (Info.MinArity && Info.MinArity == Info.MaxArity &&
+        Info.MinArity != Args.size())
+      return DiagInfo{Info.MinArity, 0};
+    if (Info.MinArity && Args.size() < Info.MinArity)
+      return DiagInfo{Info.MinArity, 1};
+    if (Info.MaxArity && Args.size() > Info.MaxArity)
----------------
rsmith wrote:
> This only works if none of the arguments are pack expansions.
Hmm. Interesting. The TypeTraitExpr parsing does the same thing. 

Is the appropriate fix to delay the diagnostic until pack expansions have been expanded much later?


https://reviews.llvm.org/D45131





More information about the cfe-commits mailing list