編譯器警告 C4950
'type_or_member' : 標記為過時
成員或類型已標示為已過時的屬性 ObsoleteAttribute 。
C4950 一律發出為錯誤。 您可以使用 warning pragma 指示詞或 /wd 編譯器選項來關閉此警告 。
範例
下列範例會產生 C4950:
// C4950.cpp
// compile with: /clr
using namespace System;
// Any reference to Func3 should generate an error with message
[System::ObsoleteAttribute("Will be removed in next version", true)]
Int32 Func3(Int32 a, Int32 b) {
return (a + b);
}
int main() {
Int32 MyInt3 = ::Func3(2, 2); // C4950
}
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應