aaron.ballman added a comment.

In D55069#1313591 <https://reviews.llvm.org/D55069#1313591>, @steveire wrote:

> The follow-up patch didn't build anymore with the `&&`.
>
>   ../tools/clang/lib/AST/ASTDumper.cpp:2672:75: error: cannot bind rvalue 
> reference of type ‘const clang::comments::FullComment*&&’ to lvalue of type 
> ‘const clang::comments::FullComment* const’
>        ConstCommentVisitor<ASTDumper, void, const FullComment *>::visit(C, 
> FC);
>  
>


Huh, that's surprising. It's a perfect forwarding reference and that use would 
be binding an lvalue reference, not an rvalue reference (I believe -- it's a 
bit hard to tell given that the patch with the uses is split out). Did you 
update both `visit()` and `visitComment()`? I just noticed that StmtVisitor 
also does not use perfect forwarding, so perhaps this isn't critical, but I'm 
curious as to why this doesn't behave as expected. One of the reasons I think 
this may be important is with the JSON dumper -- it may pass around JSON values 
rather than references and rely on move semantics to make this work.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55069/new/

https://reviews.llvm.org/D55069



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to