aaron.ballman added inline comments.

================
Comment at: lib/AST/ASTContext.cpp:7930
@@ -7931,3 +7929,3 @@
 
-ASTMutationListener::~ASTMutationListener() { }
+ASTMutationListener::~ASTMutationListener() = default;
 
----------------
Eugene.Zelenko wrote:
> aaron.ballman wrote:
> > This is... interesting. Explicitly defaulting an out-of-line function 
> > definition is not something I've ever encountered before. What benefit does 
> > this provide?
> It's explicitly tells that destructor has default implementation.
I'm not certain this is an improvement. Using =default in the declaration is an 
improvement because it tells the compiler up front "this has the default 
implementation" and the compiler can benefit from that information in other 
ways. When it's on an out-of-line definition, it does say "this has the default 
implementation", but it doesn't give the compiler any benefit over {}, so the 
only benefit is up to the reader of the code. I think someone can read {} to 
easily tell it is the default behavior, it is considerably shorter, and it 
doesn't cause anyone's eyes to trip over it wondering about the construct.


Repository:
  rL LLVM

http://reviews.llvm.org/D14560



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

Reply via email to