【发布时间】:2013-10-24 17:39:35
【问题描述】:
如何获得以下代码以在 g++ 4.7 上编译?如果我将foo 的主体内联,它将编译,但我不希望它内联(因为真正的代码要复杂得多)。
struct A
{
void foo();
} __attribute__((__may_alias__));
void A::foo() {}
int main() {return 0;}
错误:
/tmp/test.cpp:6:6: error: prototype for ‘void A::foo()’ does not match any in class ‘A’
/tmp/test.cpp:3:8: error: candidate is: void A::foo()
【问题讨论】:
标签: c++ g++-4.7 gcc-extensions