[LLVMbugs] [Bug 18393] New: Invalid code accepted
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Jan 5 15:19:34 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18393
Bug ID: 18393
Summary: Invalid code accepted
Product: clang
Version: 3.3
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: pipping at exherbo.org
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
class Parent {
void virtual f() = 0;
};
class Child : public Parent {
void virtual f() {};
};
class X {
public:
X() : v_() {}
Parent g() const { return v_; }
private:
Child const v_;
};
void f(Parent const &) {}
int main(void) {
X x;
f(x.g());
}
Rejected by gcc, (4.7.2) accepted by clang. I believe gcc is right since x.g()
returns a copy of a an abstract class, which doesn't make any sense.
--
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/20140105/24ce551d/attachment.html>
More information about the llvm-bugs
mailing list