Share via


コンパイラの警告 (レベル 4、オフ) C4339

'type': 未定義の型の使用が WinRT または CLR meta-data で検出されました。この型を使用するとランタイム例外が起きる可能性があります。

Windows ランタイムまたは共通言語ランタイム用にコンパイルされたコードで型が定義されていませんでした。 ランタイム例外の可能性を回避するために、型を定義します。

既定では、この警告はオフに設定されています。 詳細については、「 Compiler Warnings That Are Off by Default」を参照してください。

次の例では C4339 が生成され、その修正方法が示されています。

// C4339.cpp
// compile with: /W4 /clr /c
// C4339 expected
#pragma warning(default : 4339)

// Delete the following line to resolve.
class A;

// Uncomment the following line to resolve.
// class A{};

class X {
public:
   X() {}

   virtual A *mf() {
      return 0;
   }
};

X * f() {
   return new X();
}