以下各节指定了 C/C++test 不支持的 GCC 编译器扩展。这些限制适用于受支持的基于 GCC 的编译器以及自定义 GCC 编译器构建。有关 GNU 编译器扩展的更多信息,请参见http://gcc.gnu.org/onlinedocs。
可变长度数组作为函数的参数
void tester (int len, char data[len][len]) { } |
具有覆盖返回类型的虚函数
class A { public: virtual void* a(); }; class B: public A { public: virtual B* a(); // Return type changed from void* to (compatible) B*. // It is ok in GCC but EDG will complain }; |
限制成员函数的指针别名
class T { public: void fn(); }; void T::fn () __restrict__ // EDG won't compile this { } |
功能属性
void fatal () __attribute__ ((noreturn)); void fatal () { } typedef void voidfn (); volatile voidfn fatal; // EDG: declaration is incompatible with // "void fatal()" |
Friend 声明
class A; namespace N { class B { friend class A; // In GCC 4.0+ it refer to N::A (which has not been // declared yet) But EDG and older GCCs refer to ::A int _private; }; class A { void foo() { B b; b._private = 0; // EDG inaccessible field. } }; } |
与 GCC 4.0.x 相同。
与 GCC 4.0.x 相同。
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同。
与 GCC 4.0.x 相同
与 GCC 4.0.x 相同。
与 GCC 4.0.x 相同。
不支持 C++2a 功能。
与 GCC 4.0.x 相同。
不支持 C++2a 功能。