Is there a way to get a non const reference to the ASTContext inside of a clang 
tidy check?  I have two reasons I want this.  

1. To do matches on specific nodes like below. 

void MyCheck::check(const MatchFinder::MatchResult &Result) {
        auto const *Lambda = Result.Nodes.getNodeAs<CXXRecordDecl>("Lambda");

        // Doesn’t work because Context is a const* and match has no const 
overloads
        auto BN = match(<more matchers here>, Lambda, *Result.Context);
}

2. To use the ExprMutationAnalyzer in my check function, which requires a non 
const ASTContext reference for its constructor. 

-Cannada Lewis 

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

Reply via email to