================
Comment at: lib/Sema/SemaDecl.cpp:9935-9936
@@ -9934,4 +9934,4 @@
     if (!FD->isInvalidDecl()) {
-      DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());
-      DiagnoseSizeOfParametersAndReturnValue(FD->param_begin(), 
FD->param_end(),
-                                             FD->getReturnType(), FD);
+      // In case of cxx11, Body is null if function is marked deleted/ 
defaulted
+      // out-of-line. Calling these DiagnoseXXX in such cases is not useful.
+      if (Body) {
----------------
This comment should be higher level, explaining why it's doing this, not how 
it's doing it.  The code itself is fairly obvious.  For example:
  // Don't diagnose unused parameters of defaulted or deleted functions.

================
Comment at: lib/Sema/SemaDecl.cpp:9939-9940
@@ +9938,4 @@
+        DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());
+        DiagnoseSizeOfParametersAndReturnValue(
+            FD->param_begin(), FD->param_end(), FD->getReturnType(), FD);
+      }
----------------
This might apply to a copy constructor for a large class.  Consider:

  struct A {
    int a[LARGE];
    A(A a);
  };
  A::A(A a) = default; // expected-warning {{...}}

http://reviews.llvm.org/D3376



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to