<div dir="ltr">Looks good! Do you need someone to commit it?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 26, 2014 at 11:19 AM, Dinesh Dwivedi <span dir="ltr"><<a href="mailto:dinesh.d@samsung.com" target="_blank">dinesh.d@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Updated as per comment.<br>
<br>
Thanks for review<br>
<div class=""><br>
<a href="http://reviews.llvm.org/D3376" target="_blank">http://reviews.llvm.org/D3376</a><br>
<br>
Files:<br>
lib/Sema/SemaDecl.cpp<br>
test/SemaCXX/cxx11-unused.cpp<br>
<br>
Index: lib/Sema/SemaDecl.cpp<br>
===================================================================<br>
--- lib/Sema/SemaDecl.cpp<br>
+++ lib/Sema/SemaDecl.cpp<br>
</div>@@ -9919,7 +9919,9 @@<br>
<div class=""> Diag(FD->getLocation(), diag::warn_pure_function_definition);<br>
<br>
if (!FD->isInvalidDecl()) {<br>
- DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());<br>
</div>+ // Don't diagnose unused parameters of defaulted or deleted functions.<br>
<div class="">+ if (Body)<br>
+ DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());<br>
</div> DiagnoseSizeOfParametersAndReturnValue(FD->param_begin(), FD->param_end(),<br>
FD->getReturnType(), FD);<br>
<br>
<div class="HOEnZb"><div class="h5">Index: test/SemaCXX/cxx11-unused.cpp<br>
===================================================================<br>
--- /dev/null<br>
+++ test/SemaCXX/cxx11-unused.cpp<br>
@@ -0,0 +1,33 @@<br>
+// RUN: %clang_cc1 -std=c++11 -verify %s -Wunused-parameter<br>
+<br>
+// PR19303 : Make sure we don't get a unused expression warning for deleted and<br>
+// defaulted functions<br>
+<br>
+// expected-no-diagnostics<br>
+<br>
+class A {<br>
+public:<br>
+ int x;<br>
+ A() = default;<br>
+ ~A() = default;<br>
+ A(const A &other) = delete;<br>
+<br>
+ template <typename T><br>
+ void SetX(T x) {<br>
+ this->x = x;<br>
+ };<br>
+<br>
+ void SetX1(int x);<br>
+};<br>
+<br>
+template <><br>
+void A::SetX(A x) = delete;<br>
+<br>
+class B {<br>
+public:<br>
+ B() = default;<br>
+ ~B() = default;<br>
+ B(const B &other);<br>
+};<br>
+<br>
+B::B(const B &other) = default;<br>
</div></div></blockquote></div><br></div>