共用方式為


編譯器錯誤 C2381

'function': 重複定義; '__declspec(noreturn)' 不相同

函式已宣告並定義,但定義使用 noreturn __declspec 修飾詞。 使用 noreturn 構成函式的重新定義;宣告和定義需要就使用 noreturn 達成一致。

下列範例會產生 C2381:

// C2381.cpp
// compile with: /c
void f1();
void __declspec(noreturn) f1() {}   // C2381
void __declspec(noreturn) f2() {}   // OK