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