tzik marked an inline comment as done.
tzik added inline comments.

================
Comment at: lib/Sema/SemaExprCXX.cpp:5108
     QualType UseType = isIndirect ? Context.getPointerType(Class) : Class;
+    UseType = 
UseType.withCVRQualifiers(LHS.get()->getType().getCVRQualifiers());
     ExprValueKind VK = isIndirect ? VK_RValue : LHS.get()->getValueKind();
----------------
rsmith wrote:
> In the "indirect" case, the cv-qualifiers should be taken from the pointee 
> type of the LHS and applied to the pointee type of UseType. I believe this 
> patch will not be enough to cause us to reject the indirect version of your 
> testcase:
> 
> ```
>   ((&b)->*&B::f)();  // expected-error{{drops 'const' qualifier}}
> ```
> 
> Moreover, we should be preserving all qualifiers, not just cvr-qualifiers; 
> for example, this should also preserve the address space.
Make sense. OK, I updated the CL to cover that cases.
Could you take another look?


https://reviews.llvm.org/D33875



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

Reply via email to