gribozavr2 added inline comments.
================ Comment at: clang/unittests/Tooling/Syntax/TreeTest.cpp:2192 R"cpp( +class osstream {}; struct X { ---------------- eduucaldas wrote: > gribozavr2 wrote: > > eduucaldas wrote: > > > gribozavr2 wrote: > > > > I don't think we need a separate class to show the left shift operator. > > > > The declaration below can be: > > > > > > > > ``` > > > > friend X operator<<(X&, const X&); > > > > ``` > > > If we don't bother much about "realistic" operator declarations we could > > > drop all the `friend` and declare every operator in their most concise > > > form. WDYT > > I think we shouldn't try to make tests realistic in terms of function names > > etc., but we should try to cover as many different AST shapes as possible. > > In the case of binary operators, we have three cases -- free function, > > friend function, member function, that all generate slightly different > > ASTs, so I believe we should try to cover them all. > But those all regard the operators declaration. > Here we test the operator call expression - `CXXOperatorCallExpr`. > > I think we should test friend function declarations when we add support for > them in the tree, and then we add tests for declaration of friend operators, > friend member functions and whatnot. The call expression AST node can be meaningfully different between calls to member and non-member functions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82954/new/ https://reviews.llvm.org/D82954 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits