[Bug c++/41050] New: Placement new not seeing base class protected functions
igodard at pacbell dot net
gcc-bugzilla@gcc.gnu.org
Thu Aug 13 02:38:00 GMT 2009
This code:
#include <memory>
class foo {
protected:
foo() {}
foo(int) {}
public:
};
class bar : public foo {
public:
bar() : foo() {
new (this) foo(5);
}
};
bar b;
gets you:
~/ootbc/sim$ g++ foo.cc
foo.cc: In constructor Âbar::bar()Â:
foo.cc:5: error: Âfoo::foo(int)Â is protected
foo.cc:12: error: within this context
--
Summary: Placement new not seeing base class protected functions
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41050
More information about the Gcc-bugs
mailing list