jvikstrom marked an inline comment as done.
jvikstrom added inline comments.


================
Comment at: 
clang/unittests/Tooling/RecursiveASTVisitorTests/ImplicitCtorInitializer.cpp:29
+    if (!Init->isWritten())
+      VisitedImplicitInitializer = true;
+    Match("initializer", Init->getSourceLocation());
----------------
ilya-biryukov wrote:
> NIT: alternatively use different match identifiers for written and unwritten 
> initializers:
> ```
> if (Init->isWritten())
>   Match("written-inititiazlier", ...);
> else
>   Match("implicit-initializer", ...);
> 
> ...
> TEST() {
>   Visitor.expectMatch("written-initializer");
>   Visitor.disallowMatch("implicit-initializer"); // would that work with 
> invalid source locs, though?
> }
> ```
> 
> This allows to reuse the mechanism used by other tests without extra code. 
> But up to you, definitely not a big deal.
disallowMatch requires a valid SourceLocation otherwise that would definitely 
be the way to do it.

Maybe that is something that should be added (the ability to disallow matches 
no matter what location) to ExpectedLocationVisitor?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65735/new/

https://reviews.llvm.org/D65735



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

Reply via email to