[cfe-dev] AST matchers and const ASTContext

Manuel Klimek via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 5 03:37:45 PDT 2016

the MatchResult has a clang::ASTContext* const field, not a
clang::ASTContext const * - am I missing something?

On Sat, Sep 3, 2016 at 4:25 AM Julian Bangert via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello,
> is there a particular reason why clang::ast_matchers::match (
> http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder.html#a8b5a0b1b4d21c32009ad9e75ef8d5502)
> requires a non-const reference to a clang::ASTContext, but the matchresuly
> only has a const clang::ASTContext *field? This makes it hard to further
> apply matchers on the match result.
> At least conceptually, shouldn't the AST matcher not modify the AST it
> operates on (and therefore be able to accept a const context)?
> If  the AST matcher has state that some matchers might modify, should we
> instead return a mutable ASTContext in matchresult?
> Regards,
> Julian
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160905/46e888f2/attachment.html>

More information about the cfe-dev mailing list