[PATCH] Adding lvalue and rvalue reference type matchers

Manuel Klimek klimek at google.com
Thu Mar 7 07:34:38 PST 2013



================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:2953
@@ +2952,3 @@
+/// \c lvalueReferenceType() matches the type of \c b.
+AST_TYPE_MATCHER(LValueReferenceType, lvalueReferenceType);
+
----------------
Edwin Vane wrote:
> Manuel Klimek wrote:
> > Seems like the correct indentation would be lValueReferenceType? (I can see why we might not want that ;)
> I was going to argue the spec treats 'lvalue' as a noun and so keeping with  matchers not capitalizing the first word I chose that option. But I see now the precedent has already been set: LLVM treats 'lvalue' as two words (at least for capitalization) otherwise it'd be clang::LvalueReferenceType. Stick with the precedent?
sg

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:2942
@@ +2941,3 @@
+///
+/// See C++ [dcl.ref].
+///
----------------
Edwin Vane wrote:
> Manuel Klimek wrote:
> > I'd vote against putting in comments that reference the C++ standard. Instead, we should put those comments on the AST nodes themselves. If I remember correctly, there was a lot of agreement on the idea of better doxygen comments for the AST nodes, but so far nobody has stepped up :)
> I'm about to add a bunch more comments suggested from @gribozavr that reference the spec. I can leave out the cross references but can I at least still mention 'reference collapsing rules'?
If you have a full sentence explanation that will be easier to understand with a spec reference, go for it. I don't think it's necessary to reference to lvalue and rvalue references, though.


http://llvm-reviews.chandlerc.com/D503

BRANCH
  rlvalue_ref

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list