================
@@ -272,15 +278,29 @@ auto isOptionalNulloptConstructor() {
 }
 
 auto isOptionalInPlaceConstructor() {
-  return cxxConstructExpr(hasArgument(0, hasType(inPlaceClass())),
+  return cxxConstructExpr(hasAnyArgument(hasType(inPlaceClass())),
                           hasOptionalOrDerivedType());
 }
 
+// `optional(value, ...)`. Arguments after the value are ignored. Tag types are
+// excluded because they denote other constructions.
 auto isOptionalValueOrConversionConstructor() {
   return cxxConstructExpr(
       unless(hasDeclaration(
           cxxConstructorDecl(anyOf(isCopyConstructor(), 
isMoveConstructor())))),
-      argumentCountIs(1), hasArgument(0, unless(hasNulloptType())),
+      argumentCountAtLeast(1),
+      hasArgument(0, unless(anyOf(hasNulloptType(), hasType(inPlaceClass()),
+                                  hasAllocatorArgType()))),
+      hasOptionalOrDerivedType());
+}
+
+// `optional(allocator_arg_t, allocator, value, ...)`.
----------------
BaLiKfromUA wrote:

Done 
https://github.com/llvm/llvm-project/pull/224969/changes/282ed09e677cd9880a6de1855aaf2e60d5f858e9

JFYI, we might want to limit matchers to only Bloomberg components but maybe 
it's an overkill.

https://github.com/llvm/llvm-project/pull/224969
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to