我有一个从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不应该处理这件事。
https://stackoverflow.com/questions/52098695
复制相似问题