[PATCH] D99576: [ASTImporter][NFC] Improve test coverage

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 31 06:03:13 PDT 2021


thakis added a comment.

Thanks, that bot is happy again.



================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:3089
+struct ImportBlock : ASTImporterOptionSpecificTestBase {};
+const internal::VariadicDynCastAllOfMatcher<Decl, BlockDecl> blockDecl;
+TEST_P(ImportBlock, ImportBlocksAreUnsupported) {
----------------
steakhal wrote:
> steakhal wrote:
> > thakis wrote:
> > > steakhal wrote:
> > > > thakis wrote:
> > > > > Does this have to be a global? It can just be in the TEST_P, no?
> > > > > 
> > > > > As-is, this causes linker errors: http://45.33.8.238/linux/43089/step_4.txt
> > > > > 
> > > > > If it does have to be a global for some reason, please put it in an unnamed namespace.
> > > > Hmm I don't know. I was just copy-pasting from for example line 515.
> > > > ```lang=c++
> > > > const internal::VariadicDynCastAllOfMatcher<Expr, VAArgExpr> vaArgExpr;
> > > > ```
> > > > How is my case different from that?
> > > > I thought it's the way of doing this.
> > > I think the vaArgExpr on line 515 could be local to the ImportVAArgExpr test too.
> > > 
> > > What's different with your test is that ASTMatchersInternal.cpp already has a global symbol called `blockDecl`, leading to a duplicate symbol error.
> > > 
> > > …actually I guess you could just use that one? I think you can just delete the `blockDecl` line completely and things will probably be fine.
> > I pushed the change. I hope it fixes the issue.
> > I don't know how I missed it. Thanks for the heads up.
> @thakis How did the premerge test pass then?
> That supposed to catch build bot issues before the revision lands, am I right?
It probably only tests on config. Might depend on if dead code stripping is enabled (?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99576



More information about the cfe-commits mailing list