[cfe-commits] r168818 - in /cfe/trunk: lib/Sema/TreeTransform.h test/SemaTemplate/instantiate-overload-candidates.cpp

Pawel Wodnicki pawel at 32bitmicro.com
Wed Nov 28 15:46:31 PST 2012


>
> On Nov 28, 2012, at 2:09 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> 
>> This fixes release blocker PR13098. Doug, OK for 3.2?
> 
> This is very important. Approved.

Committed revision 168830.

Pawel

> 
> 	- Doug
> 
>> On Wed, Nov 28, 2012 at 1:47 PM, Richard Smith <richard-llvm at metafoo.co.uk> wrote:
>> Author: rsmith
>> Date: Wed Nov 28 15:47:39 2012
>> New Revision: 168818
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=168818&view=rev
>> Log:
>> PR13098: If we're instantiating an overloaded binary operator and we could
>> determine which member function would be the callee from within the template
>> definition, don't pass that function as a "non-member function" to
>> CreateOverloadedBinOp. Instead, just rely on it to select the member function
>> for itself.
>>
>> Modified:
>>     cfe/trunk/lib/Sema/TreeTransform.h
>>     cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp
>>
>> Modified: cfe/trunk/lib/Sema/TreeTransform.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=168818&r1=168817&r2=168818&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Sema/TreeTransform.h (original)
>> +++ cfe/trunk/lib/Sema/TreeTransform.h Wed Nov 28 15:47:39 2012
>> @@ -9180,7 +9180,12 @@
>>      // IsAcceptableNonMemberOperatorCandidate for each of these?
>>      Functions.append(ULE->decls_begin(), ULE->decls_end());
>>    } else {
>> -    Functions.addDecl(cast<DeclRefExpr>(Callee)->getDecl());
>> +    // If we've resolved this to a particular non-member function, just call
>> +    // that function. If we resolved it to a member function,
>> +    // CreateOverloaded* will find that function for us.
>> +    NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();
>> +    if (!isa<CXXMethodDecl>(ND))
>> +      Functions.addDecl(ND);
>>    }
>>
>>    // Add any functions found via argument-dependent lookup.
>>
>> Modified: cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp?rev=168818&r1=168817&r2=168818&view=diff
>> ==============================================================================
>> --- cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp (original)
>> +++ cfe/trunk/test/SemaTemplate/instantiate-overload-candidates.cpp Wed Nov 28 15:47:39 2012
>> @@ -27,3 +27,25 @@
>>    static T f(bool);
>>  };
>>  void (*p)() = &X<void>().f; // expected-note {{instantiation of}}
>> +
>> +namespace PR13098 {
>> +  struct A {
>> +    A(int);
>> +    void operator++() {}
>> +    void operator+(int) {}
>> +    void operator+(A) {}
>> +    void operator[](int) {}
>> +    void operator[](A) {}
>> +  };
>> +  struct B : A {
>> +    using A::operator++;
>> +    using A::operator+;
>> +    using A::operator[];
>> +  };
>> +  template<typename T> void f(B b) {
>> +    ++b;
>> +    b + 0;
>> +    b[0];
>> +  }
>> +  template void f<void>(B);
>> +}
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
> 
> 




More information about the cfe-commits mailing list