https://llvm.org/bugs/show_bug.cgi?id=26390
Bug ID: 26390 Summary: Can't match parenExpr() in a unaryOperator() Product: clang Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: libclang Assignee: unassignedclangb...@nondot.org Reporter: legal...@xmission.com CC: kli...@google.com, llvm-bugs@lists.llvm.org Classification: Unclassified clanger> cat /tmp/a.cpp int negation(int a, int b) { if (!(a < b)) return 0; if (!(a <= b)) return 1; if (!(a == b)) return 2; if (!(a >= b)) return 3; if (!(a > b)) return 4; return 5; } ~/dev/build clanger> bin/clang-query /tmp/a.cpp -- -std=c++11 clang-query> match parenExpr() Match #1: /tmp/a.cpp:2:8: note: "root" binds here if (!(a < b)) ^~~~~~~ Match #2: /tmp/a.cpp:4:8: note: "root" binds here if (!(a <= b)) ^~~~~~~~ Match #3: /tmp/a.cpp:6:8: note: "root" binds here if (!(a == b)) ^~~~~~~~ Match #4: /tmp/a.cpp:8:8: note: "root" binds here if (!(a >= b)) ^~~~~~~~ Match #5: /tmp/a.cpp:10:8: note: "root" binds here if (!(a > b)) ^~~~~~~ 5 matches. clang-query> match unaryOperator() Match #1: /tmp/a.cpp:2:7: note: "root" binds here if (!(a < b)) ^~~~~~~~ Match #2: /tmp/a.cpp:4:7: note: "root" binds here if (!(a <= b)) ^~~~~~~~~ Match #3: /tmp/a.cpp:6:7: note: "root" binds here if (!(a == b)) ^~~~~~~~~ Match #4: /tmp/a.cpp:8:7: note: "root" binds here if (!(a >= b)) ^~~~~~~~~ Match #5: /tmp/a.cpp:10:7: note: "root" binds here if (!(a > b)) ^~~~~~~~ 5 matches. clang-query> match unaryOperator(parenExpr()) 0 matches. clang-query> match unaryOperator(has(parenExpr())) 0 matches. clang-query> ^D -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs