chiasa.men via llvm-dev
2021-Sep-22 10:55 UTC
[llvm-dev] Each StringLiteral in InitListExpr matched twice
Example: https://godbolt.org/z/1hjzrv1d7 There are 2 StringLiterals in an array. m stringLiteral() matches either twice (so produces 4 matches) Is that intended behaviour, if so, how to determine the second match? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210922/05caa41f/attachment.html>
Aaron Ballman via llvm-dev
2021-Sep-22 11:17 UTC
[llvm-dev] [cfe-dev] Each StringLiteral in InitListExpr matched twice
On Wed, Sep 22, 2021 at 6:55 AM chiasa.men via cfe-dev <cfe-dev at lists.llvm.org> wrote:> > Example: https://godbolt.org/z/1hjzrv1d7 > > > There are 2 StringLiterals in an array. > > m stringLiteral() > > matches either twice (so produces 4 matches) > > > Is that intended behaviour, if so, how to determine the second match?That looks like a bug with AST traversal of the InitListExpr to me. It's not specific to string literals, I can reproduce the behavior with an initializer list using integers as well. ~Aaron> > _______________________________________________ > cfe-dev mailing list > cfe-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev