नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'keyword': ignored on left of 'type' when no variable is declared
Remarks
The compiler detected a situation where the user probably intended a variable to be declared, but the compiler wasn't able to declare the variable.
Examples
A __declspec attribute at the beginning of a user-defined type declaration applies to the variable of that type. C4091 indicates no variable is declared. The following example generates C4091.
// C4091.cpp
// compile with: /W1 /c
__declspec(dllimport) class X {}; // C4091
// __declspec attribute applies to varX
__declspec(dllimport) class X2 {} varX;
// __declspec attribute after the class or struct keyword
// applies to user defined type
class __declspec(dllimport) X3 {};
If an identifier is a typedef, it can't also be a variable name. The following example generates C4091.
// C4091_b.cpp
// compile with: /c /W1 /WX
#define LIST 4
typedef struct _LIST {} LIST; // C4091