我有一个项目要从 glibc 移植到 uclibc,但遇到了这个奇怪的问题。
gcc --std=c++11 Foo.cpp -o Foo-glibc
x86_64-linux-uclibc-gcc --std=c++11 Foo.cpp -o Foo-uclibc
// Compiles under glibc and uclibc
class Foo {
Foo() = default;
Foo(const Foo& arg) = delete;
~Foo() = default;
};
// Only compiles under glibc
class Foo {
Foo() = default;
Foo(const Foo& arg);
~Foo() = default;
};
Foo::Foo(const Foo& arg) = delete; // uclibc - Error: deleted definition of 'Foo::Foo(const Foo&)'
为什么会出现这个错误?这是预期的行为吗?我读过的任何内容都没有表明 uclibc 不应该能够处理这个问题。