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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to