[LLVMbugs] [Bug 23066] New: ABC value parameter should be rejected

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 30 01:15:39 PDT 2015


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

            Bug ID: 23066
           Summary: ABC value parameter should be rejected
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wilhelm.meier at hs-kl.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code should be rejected: 

passing an ABC per value isn't possible.

class Abc
{
public:
    virtual void foo() const = 0;
    virtual ~Abc() {}
};
class Impl : public Abc {
public:
    void foo() const {}
};
class B
{
public:
    void bar(Abc o)
    {
        o.foo();
    }
};
int main()
{
    B b;
    Impl i;
    b.bar(i);
}

-- 
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/20150330/954cd5b1/attachment.html>


More information about the llvm-bugs mailing list