<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 28, 2012, at 2:09 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">This fixes release blocker PR13098. Doug, OK for 3.2?<br></blockquote><div><br></div>This is very important. Approved.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>- Doug</div><div><br><blockquote type="cite"><div class="gmail_quote">On Wed, Nov 28, 2012 at 1:47 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard-llvm@metafoo.co.uk" target="_blank">richard-llvm@metafoo.co.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rsmith<br>
Date: Wed Nov 28 15:47:39 2012<br>
New Revision: 168818<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=168818&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=168818&view=rev</a><br>
Log:<br>
PR13098: If we're instantiating an overloaded binary operator and we could<br>
determine which member function would be the callee from within the template<br>
definition, don't pass that function as a "non-member function" to<br>
CreateOverloadedBinOp. Instead, just rely on it to select the member function<br>
for itself.<br>
<br>
Modified:<br>
    cfe/trunk/lib/Sema/TreeTransform.h<br>
    cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/TreeTransform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=168818&r1=168817&r2=168818&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=168818&r1=168817&r2=168818&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/lib/Sema/TreeTransform.h (original)<br>
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed Nov 28 15:47:39 2012<br>
@@ -9180,7 +9180,12 @@<br>
     // IsAcceptableNonMemberOperatorCandidate for each of these?<br>
     Functions.append(ULE->decls_begin(), ULE->decls_end());<br>
   } else {<br>
-    Functions.addDecl(cast<DeclRefExpr>(Callee)->getDecl());<br>
+    // If we've resolved this to a particular non-member function, just call<br>
+    // that function. If we resolved it to a member function,<br>
+    // CreateOverloaded* will find that function for us.<br>
+    NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();<br>
+    if (!isa<CXXMethodDecl>(ND))<br>
+      Functions.addDecl(ND);<br>
   }<br>
<br>
   // Add any functions found via argument-dependent lookup.<br>
<br>
Modified: cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp?rev=168818&r1=168817&r2=168818&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp?rev=168818&r1=168817&r2=168818&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp (original)<br>
+++ cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp Wed Nov 28 15:47:39 2012<br>
@@ -27,3 +27,25 @@<br>
   static T f(bool);<br>
 };<br>
 void (*p)() = &X<void>().f; // expected-note {{instantiation of}}<br>
+<br>
+namespace PR13098 {<br>
+  struct A {<br>
+    A(int);<br>
+    void operator++() {}<br>
+    void operator+(int) {}<br>
+    void operator+(A) {}<br>
+    void operator[](int) {}<br>
+    void operator[](A) {}<br>
+  };<br>
+  struct B : A {<br>
+    using A::operator++;<br>
+    using A::operator+;<br>
+    using A::operator[];<br>
+  };<br>
+  template<typename T> void f(B b) {<br>
+    ++b;<br>
+    b + 0;<br>
+    b[0];<br>
+  }<br>
+  template void f<void>(B);<br>
+}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>
</blockquote></div><br></body></html>