[llvm-bugs] [Bug 27398] New: Clang drops qualifiers when invoking a non-const PMF via a const derived object.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 18 01:07:16 PDT 2016


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: unassignedclangbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: dgregor at apple.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160418/cf08430d/attachment.html>


More information about the llvm-bugs mailing list