https://llvm.org/bugs/show_bug.cgi?id=27398

            Bug ID: 27398
           Summary: Clang drops qualifiers when invoking a non-const PMF
                    via a const derived object.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: e...@efcs.ca
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
    Classification: Unclassified

When invoking a PMF of the form 'Ret (T::*)(<...>)" using an object of type 'D'
derived from 'T', clang will allow that object to be const. For example.

struct Base { void mutate() {} };
struct Derived : Base {};

const Derived d;
auto pmf = & Base::mutate;
(d.*pmf)(); // allowed
Base b;
(b.*pmf)(); // rejected; drops qualifiers.


This is possibly related to "PR 23409 - Missing qualifiers in derived to base
implicit casts"  (https://llvm.org/bugs/show_bug.cgi?id=23409)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to