************************************* ERROR AND WARNING MESSAGES FILE ************************************* This file contains the Sun ANSI C++ compiler (ccfe) error and warning messages. It does not contain messages issued by the other components of the CC driver, such as the optimizer, code generator, or linker. The format for the messages is: o Message o Description o Example of code that generates the message o Message ID (tag) Not all messages have descriptions or code examples. There are two types of compiler messages: o Warning messages, in which the word "Warning" is displayed after the file name and line number, provide useful information without interrupting compilation. They may diagnose a programming error, or a violation of C++ syntax or semantics, for which the compiler nevertheless generates valid object code. o Error messages, in which the word "Error" prefix, cause the comiler command to fail. Errors occur when the compiler has diagnosed a serious problem that makes it unable to understand the program or to continue to generate correct object code. It attempts to examine the rest of your program for other errors, however. The compiler does not link your program if the compiler diagnoses errors. The phrase "Internal error, should not occur," followed by some message, usually does not diagnose a programming error, but rather a problem with the compiler. One of the compiler's internal consistency checks has failed. The problem diagnosed by the message issued is important; you can help Sun Microsystems, Inc. identify the problem by doing the following: 1. Run the CC command again with the same options as when it failed, plus the -P option. Output will be placed in a file with a .i suffix in your current directory. This file will help to identify the compiler problem. 2. Call your authorized service provider. You can find an authorized service provider by contacting your Sun Microsystems, Inc. reseller. *************************************
This message is generated in the case of internal compiler error. Please note the circumstances surrounding the error and contact Sun (contact information).
Message ID: noerror
The compiler attempted to compute the result of a floating addition at compile-time, and determined that the result overflows. The low-order 32 bits of the result are retained, and the compiler issues this diagnostic.
Message ID: addfovfl
The compiler attempted to compute the result of an addition at compile-time, and determined that the result overflows. The low-order 32 bits of the result are retained, and the compiler issues this diagnostic.
Message ID: addovfl
The class has already used an outer scope name, and cannot redefine the name. Example of code that generates the error message:
typedef int Integer; class A { Integer i; float Integer; //ERROR: redefining Integer after use in A };
Message ID: alreadyusedc
The template has already been used locally, and cannot be redefined. Example of code that generates the warning message:
template <class T> class A{}; class B { A<int> a1; float A; // Warning }; template <class T> class C { A<float> a2; long A; }; C<int> ac; // Warning
Message ID: alreadyusedt
The name exists in both the base classes: %3 and %4. Use the scope operator to specify the one you want. Example of code that generates the error message:
struct A { int i; }; struct A2 { int i; }; struct B: A, A2 { B() { i = 7; } // ERROR: the name i is ambiguous in B: A::i and A2::i };
Message ID: ambigfield
The base class is included in two or more of the base classes of a class. You must specify which one you mean. Example of code that generates the error message:
struct B { int i; }; struct B1: B { int j; }; struct B2: B { int j; }; struct A: B1, B2 { A() { i = 7; // ERROR: B::i ambiguous B1::i = 7; // ok B2::i = 7; // ok } };
Message ID: ambigbfield
The base class is ambiguous: it was included on one or more bases. Example of code that generates the error message:
struct A { int i; }; struct B: A { int j; }; struct C: A, B { int k; void foo() { A::i = 10; // Error: The base class A is ambiguous in C. }; };
Message ID: ambigbspec
The same name is found in two or more of the base classes. Specify which one you want. Example of code that generates the error message:
struct B1 { void foo(){} }; struct B2 { void foo(){} }; struct A: B1, B2 { int i; }; void bar() { A a; a.foo(); // ERROR a.B1::foo(); // ok a.B2::foo(); // ok }
Message ID: ambigname
Anonymous unions cannot have function members. Example of code that generates the error message:
static union { void foo(){} // ERROR };
Message ID: anonnofunc
Anonymous unions cannot have private or protected members. Example of code that generates the error message:
static union { long j; private: int i; // ERROR };
Message ID: anonnoprivate
Global anonymous unions must be static Example of code that generates the error message:
union { // ERROR long i; int j; float k; };
Message ID: anonnotstatic
It is illegal for a union member to have a user-defined assignment operator Example of code that generates the error message:
class A { public: int i; A &operator =(A &la); }; union B { A a; int i; };
Message ID: asgnotall
Class has a reference member. Instance of such a class cannot be assigned to. Example of code that generates the error message:
class A { public: int &i; int j; A(): i(j), j(5) {} }; void foo() { A a1; A a2; a1 = a2; // ERROR: reference member i of instance a1 cannot be assigned }
Message ID: asgwref
The member is declared const, and cannot be assigned a value. Example of code that generates the error message:
class A { public: const int i; A(): i(5) {} }; void foo() { A a1; A a2; a1 = a2; // ERROR: const member i of instance a1 cannot be assigned }
Message ID: asgwconst
A template should be declared first. Example of code that generates the warning message:
template class B<int>; // WARNING: B is not declared
Message ID: assumetemp
Access to a member cannot be changed this way. Example of code that generates the error message:
class A { protected: int i; }; class B : public A { public: A::i; // ERROR: cannot change access };
Message ID: badaccadj
Access cannot be changed because another class member exists. Example of code that generates the error message:
class A { public: int i; }; class B : public A { protected: int i; public: A::i; // ERROR: cannot change access of A::i because of B::i };
Message ID: badadjname
The unary operator is undefined for this object. To correct this, an overloaded unary operator may be defined for the type passed in. Example of code that generates the error message:
class A { int i; public: //operator ++(); // prefix operator ++ }; void foo() { A a; a++; // ERROR: overload operator ++ to correct }
Message ID: badtunaryop
The binary operation is undefined for this object. To correct this, you may overload the binary operator to take the arguments passed in. Example of code that generates the error message:
class A { int i; }; void foo() { A a, b; int i = a + b; // ERROR int j = a%b; // ERROR } void bar() { int i = 9; float j = -9.3; i % j; // ERROR }
Message ID: badbinaryop
A non-lvalue was passed into the function that takes a reference. Example of code that generates the error message:
int foo( int &i) { i = foo(1); // ERROR: "1" is not an lvalue. return 2; }
Message ID: badarglval
A non-lvalue has been passed into the function that takes a pointer or an address. Example of code that generates the error message:
int foo( int &i) { i = foo(1); // ERROR: "1" is not an lvalue. return 2; }
Message ID: badarglval2
The argument passed into the function cannot be assigned to a parameter of the function. Example of code that generates the error message:
void foo(int *cp); int main() { const char *cp = "abcd"; foo(cp); // ERROR: const char *cp being passed to int* return 0; }
Message ID: badargtype
The formal argument in a function call cannot be assigned to a parameter of the function. Example of code that generates the error message:
void foo(int *cp); int main() { const char *cp = "Hello"; foo(cp); // ERROR: const char *cp being pass to int* return 0; }
Message ID: badargtype2
The formal argument type in a function call does not match the parameter for the function. Example of code that generates the error message:
class A { public: int i; A() { i = 1; }; }; void foo(A *Ap); int main() { const A *Ap = new A(); foo(Ap); // ERROR: argument type A* being passed const A* return 0; }
Message ID: badargtypew
The formal argument type in a function call does not match the parameter of the function. Example of code that generates the warning message:
void foobar(char *c); void foo() { const char *c = "abcde"; foobar(c); // warning, char* in call to foobar being passed const char* }
Message ID: badargtypelw
The formal argument type in a function call does not match the parameter of the function. Example of code that generates the warning message:
class A { public: int i; A() { i = 1; }; }; void foo(A *Ap); int main() { const A *Ap = new A(); foo(Ap); // warning: argument type A* being passed const A* return 0; }
Message ID: badargtype2w
The formal argument type in an function call does not match the parameter of the function.
Message ID: badargtypel2w
An array initializer should be surrounded by curly brackets. Example of code that generates the warning message:
static char a [5] = ("qwer");
Message ID: badarrinit
A syntax error encountered: wrong condition type. Example of code that generates the error message:
void foo() { for ( ;int i[1] = (1); ); // ERROR: condition cannot have type int[1] };
Message ID: badcondtype
Type has an inaccessible constructor. Example of code that generates the error message:
class A { A(A& a) { }; // user defined private copy constructor public: A() {}; }; A the_a; void foo(A a) { }; void bar() { foo(the_a); }; // ERROR: Formal argument a of type A in call to // foo(A) has an inaccessible copy constructor
Message ID: badcopyacc
The object type of the formal argument in the function call does not have an accessible copy constructor. The formal argument cannot be copied to the new object. Example of code that generates the error message:
class A { A(A &a); // user defined private copy constructor public: A(); void foo(A a); } a1, a2; int main() { a2.foo(a1); // ERROR: A(A&) is private. };
Message ID: badcopyacc2
Type has an inaccessible constructor. Example of code that generates the error message:
class A { A(A& a) { }; // user defined private copy constructor public: A() {}; }; A the_a; void foo(A a) { }; void bar() { foo(the_a); }; // ERROR: Formal argument a of type A in call to // foo(A) has an inaccessible copy constructor
Message ID: badcopyaccw
The object type of the formal argument in the function call does not have an accessible copy constructor. The formal argument cannot be copied to the new object. Example of code that generates the error message:
class A { A(A &a); // user defined private copy constructor public: A(); void foo(A a); } a1, a2; int main() { a2.foo(a1); // ERROR: A(A&) is private. };
Message ID: badcopyacc2w
The object type is not an array type, and cannot use the array operator. Example of code that generates the error message:
class A { public: //A operator[] (int); } a1, a2, a3[4]; int main() { a1[7] = a2; // ERROR: a1 is not an array a3[4] = a2; // ok };
Message ID: badarraytype
There is an assignment of an object to an incompatible type. Example of code that generates the error message:
class A { int i; }; void foo() { A a; int j; j = a; // ERROR: cannot assign A to int }
Message ID: badassignment
An explicit assignment operator should be provided. Example of code that generates the error message:
class A { }; class B { public: int operator = (int ) { return 0; } // the following operator should be defined in order // to get rid of error message: // int operator = (const A&); }; int main () { A a; B b; b = a; }
Message ID: badasscasg
The base class specified is not a previously defined class or struct. Example of code that generates the error message:
class B; class A: B {}; // ERROR: the base "B" is not defined.
Message ID: badbaseclass
It is an error to have a bit field of a non-integral type. Example of code that generates the error message:
static union { float c:3; //ERROR };
Message ID: badbftype
break statements may not be outside loop or switch statements. Example of code that generates the error message:
int main() { int i = 5; break; return 0; }
Message ID: badbreak
Only integral types may be used in a switch selection expression. Example of code that generates the error message:
void foo() { float i = 9; switch(i) { // ERROR: i is not an integral type case 1: case 9: break; }; return; }
Message ID: badcasetype
The cast attempted is illegal. Use a constructor or a conversion function to convert. Example of code that generates the error message:
class A { int i; }; union B { int j; double k; }; class C { public: int c; operator A(); operator int(); }; void foo() { B b; A a; C c; b = (B)a; // ERROR: cannot cast from A to B c = (C)a; // ERROR: Cannot cast from A to C. a = A(c); // ok int i = c; // ok }
Message ID: badcast
The preprocessor directive has used an illegal character.
Message ID: badchar
A syntax error has been detected. Example of code that generates the error message:
void foo() { goto b: // ERROR: "b:" should be "b;" b: return; } class B { public: int j; A anA; class A { public: int i; }; }; int main() { B aB; aB.anA:i = 1; // ERROR: The ":" should be "." return 0; }
Message ID: badcolon
The scope operator did not precede or follow a type qualifier. Example of code that generates the error message:
class B { public: static int i; static int j; }; ::int i; // ERROR B::j = 9; // ok
Message ID: badcolon2
There should be tokens on both sides of the ## operator. Example of code that generates the error message:
#define foo(a) abc ## // ERROR
Message ID: badconcat
Only a constructor can have constructor initializers. Example of code that generates the error message:
class B { int i; B(): i(5) {} // ok void foo() : i(6) {} // ERROR };
Message ID: badconinit
The const_cast conversion is illegal. The types are not compatible. Example of code that generates the error message:
void foo() { int j = 5; const int i = j; int x = const_cast<int>(i); // ERROR: i is not an lvalue. Conversion from const int to int. int y = const_cast<float>(j); // ERROR: illegal const_cast conversion from int to float const int z = const_cast<int>(j); // ok: const_cast conversion of int to an int }
Message ID: badconstcast
Syntax error. The constant is not valid. Example of code that generates the error message:
int i = 2ooo; // ERROR int k = 0x9; //ok
Message ID: badconsterr
The error can be caused by a few cases: a non-member fuction has been declared const or volatile, or declaring a static member function const or volatile. MORE// Example of code that generates the error message:
class A { static void foo() volatile {}; // ERROR }; void foo() const {}; // ERROR
Message ID: badconstfunc
Constructors may not have a return type specification, including void. Example of code that generates the error message:
class A { int A(); // ERROR };
Message ID: badcontype
continue may only be used in a loop. Examples of loops include while, for, and do-while. Example of code that generates the error message:
void foo() { int i = 5; if ( i > 4 ) { i = 4; continue; // ERROR: continue is not in a loop } }
Message ID: badcontin
Conversion functions cannot have a return type specification. The operator type is sufficient to indicate what value is returned. Example of code that generates the error message:
class A { int j; float f; int operator int() { return j; }; // ERROR: return type may not be specified. operator float() { return f; }; // ok };
Message ID: badconvtype
User-defined conversions to type void are never used implicitly. A conversion to type void is illegal. Example of code that generates the warning message:
class A { public: operator void(); // Warning };
Message ID: wbadconvret
Syntax error encountered: declaration terminated incorrectly. Example of code that generates the error message:
class A { void f() ; { } // ERROR: declaration terminated incorrectly };
Message ID: baddeclerr
An identifier was expected during declaration parsing. It is likely that a lexical error was encountered during typedef declaration. Example of code that generates the error message:
typedef *int my_type; // ERROR: stray star
Message ID: baddecl
When declaring default values in the parameter list, all remaining parameters after the first default parameter must also have default values. Example of code that generates the error message:
template <class T=long, class K> // ERROR: no default value class A {}; void foo( int a, float b, long c = 6, double e; // ERROR int f = 2; ) {}
Message ID: baddefault
The template parameter default must be a defined or declared type. Example of code that generates the error message:
template <class T, class K> class A; template <class T, class K = Eye> class A { int i; };
Message ID: baddefaultpar
The same template declarations in the same scope with different default arguments is an error. Example of code that generates the error message:
template <class T = int> class A; template <class T = long> // ERROR class A { int i; };
Message ID: sametmpldef
It is an error to add default arguments in later declarations of a template function in the same scope. Example of code that generates the error message:
template <class T> T foo(T); template <class T> T foo(T = (T)9) // ERROR { return T; }
Message ID: badtmplfundef
The destructor must have the same name as the class name.
Message ID: baddestrname
Destructors cannot have return types, including void. Example of code that generates the error message:
class A { A(); int ~A(); };
Message ID: baddestrtype
else must be preceded by an if statement. Example of code that generates the error message:
void foo() { int i = 0; else // ERROR: no preceding if i++; }
Message ID: badelseerr
The value for an enumeration constant overflows the maximum integer value. The maximum integer value is machine dependent. Example of code that generates the error message:
#include <limits.h> enum e { e1=ULONG_MAX, e2 }; /* overflow for e2 */
Message ID: badenumrange
There is a syntax error or errors in the expression. Example of code that generates the error message:
int* foo() { return int[1]; }
Message ID: badexprerr
The language specified with extern must be "C" or "C++". Example of code that generates the error message:
extern "c" int i; // ERROR: "c" should be "C"
Message ID: badextern
The function has already been declared before with a different language. Only one language version is allowed. Example of code that generates the error message:
void foo(); extern "C" void foo() {} // ERROR: foo() was declared as C++ previously
Message ID: badextlnk
A variable has been declared before with a different language. Example of code that generates the error message:
extern "C" int i; extern "C++" int i;
Message ID: badextlnkw
The storage class used is not allowed for a member. Example of code that generates the error message:
class A { register int j; // ERROR: storage class register not allowed here extern int k; // ERROR auto int l; // ERROR };
Message ID: badfieldstore
The include file name is incorrectly formed. Example of code that generates the error message:
#include 'includefile,h' #inlcude stdio.h
Message ID: badfilename
A function should have a prototype before it is used. This message appears when the compiler is set to compile in C mode. Example of code that generates the warning message:
int main () { return foo(); // WARNING: function should have a prototype (C mode only) }
Message ID: badfunc
A function must have a prototype or a function definition before it is used in a program. Example of code that generates the error message:
int main() { goo(); // ERROR return 0; } void goo() {};
Message ID: badfunccp
Function storage types must be static or external. They may not be mutable, register, or auto. Example of code that generates the error message:
static f1(); // ok extern f2(); // ok // The following are errors: mutable f1(); // "mutable" is not allowed outside a class register f2(); auto f3();
Message ID: badfuncstore
A syntax error encountered. Most likely, wrong return type was specified in a function declaration. Example of code that generates the error message:
int a[] = {1, 2, 3, 6, 4, 5}; typedef void bar(); class A { bar goo(); // ERROR int foo()[] { return a; } // ERROR };
Message ID: badfunctype
A variable was declared in a block bypassed by goto. Example of code that generates the warning message:
int main() { int a = 2; goto next; int b = 3; // initialization of b was skipped next: a++; return 0; }
Message ID: badgoto
The include file was inaccessible or not found. It cannot be opened. Check the spelling of the include file name.
Message ID: badinclfile
An extern variable may not be initialized inside a local scope. Example of code that generates the error message:
extern int out = 2; // ok void foo() { out = 3; // ok extern int in = 9; // error extern int in2; in2 = 10; // ok };
Message ID: badinit
The class is not an aggregate object. Only classes with no constructors, no private or protected members, no base classes, and no virtual functions may use bracketed initialization. Example of code that generates the error message:
class A { int i; int j; }; A a = {1, 2}; // ERROR: i and j are private.
Message ID: badinitcl
You cannot use bracketed initialization for this object. Example of code that generates the error message:
namespace N { int i; int j; } N n = { 1, 2 };
Message ID: badinitbrace
An assignment to a reference must be made with an lvalue. Example of code that generates the error message:
int &i = 3; // ERROR const int i = 0; int &ri = i; // ERROR: const int i is not an lvalue int j = 0; int &rj = j; // ok short sv = 9; int &ir = sv; // ERROR: assignment of short to an int reference "ir" // requires that "ir" references an actual int.The following is an example for correcting an error that was previously an anachronism.
void foo() { short sv = 9; int &ir = sv; // ERROR: assignment of short to an int reference "ir" // requires that "ir" references an actual int.The following code will correct this:
int *j; *j = (int)sv; int &jr = *j; // ok, "jr" is a reference to an int. }
Message ID: badinitlval
The type used to initialize a variable is illegal. A constructor, conversion operator, or overload of the assignment operator may be used if this assignment is intended. Example of code that generates the error message:
class A { int j; public: operator int() {return j; } // conversion operator for A }; void foo() { A a; int i = a; // ok. Conversion form A to int provided a = new A(); // ERROR: using A* to initialize A }; void bar() { int i = 9; char *a = &i; // ERROR: Cannot use int* to initialize char* }
Message ID: badinittype
Array members cannot be initialized in a constructor argument list. Example of code that generates the error message:
class A { int i[3]; int j; A(): i(1,2,3), j(3) {}; };
Message ID: badarrayinit
The integer is too large to be represented on this machine. Example of code that generates the error message:
int i = 999999999999999999999999999999999;
Message ID: badinteger
Line directives require an unsigned decimal integer. Example of code that generates the error message:
#0x12 // ERROR #line 0xff "file.cc" // ERROR #line 12345 "file.cc" // ok
Message ID: badlinedir
Line directives can specify integers from 1 to 32767 only. Example of code that generates the error message:
#line 1234567 "file.cc"
Message ID: badlinenum
An identifier has previously been declared with different linkage, and it is impossible to change it. Example of code that generates the error message:
extern char * static_and_extern(); static char * static_and_extern(); // ERROR: it was declared extern, not static
Message ID: badlinkage
According to the standard, main() must have a return type of int. Example of code that generates the error message:
void main() {}
Message ID: badmain
According to the standard, it is illegal to take the address of main() function. Example of code that generates the error message:
int main() { int *a = main; return 0; }
Message ID: badmainaddr
Recursive calls of main are not allowed. Example of code that generates the error message:
int main() { main(); return 0; }
Message ID: badmaincall
main() cannot be overloaded. Example of code that generates the error message:
int main( int j) // ERROR: main () cannot be overloaded { return 0; } int main() { return 0; }
Message ID: badmainol
Members of the base class cannot be directly initialized by the derived class constructor initializer. Example of code that generates the error message:
class B { public: int i; int j; B() { i = 0; j = 0; } }; class A: B { int k; A(): i(7), j(5) { // error on i(7), j(5) cannot be initialized in a constructor B(); // ok, initializing with base class constructor i = 7; j = 9; } };
Message ID: badmembinit
It is impossible to call a member function through the pointer to a member function until class body is defined. Example of code that generates the error message:
class A; void (A::* f_ptr) (); int main () { A *a; (a->*f_ptr)(); }
Message ID: badmfcall
A member function may have the storage classes mutable, auto, register, and extern. Example of code that generates the error message:
class A { mutable void f1(); // ERROR auto void f2(); // ERROR extern void f3(); // ERROR static void f4(); // ok register void f5(); // ERROR };;
Message ID: badmfstore
An octal constant may only have the digits 0 to 7. Example of code that generates the error message:
int i = 08; // ERROR: 8 is an illegal digit for an octal number
Message ID: badoctal
Only one of a set of overloaded functions can be extern "C" Example of code that generates the error message:
extern "C" int foo (char); extern "C" int foo (double); // ERROR: extern "C" function overloaded with extern // another extern "C" function
Message ID: badollnk
The overloaded operator has been declared with too many arguments. The number of parameters the operator takes cannot be changed. Example of code that generates the error message:
class B { int j; B operator +(B, B); // ERROR: should be "B operator +(B)" };
Message ID: badopcount
The return types of the new and delete operators are incorrect. Example of code that generates the error message:
#include <stddef.h> class A { A* operator new[] (size_t); // ERROR: return type should be void* A operator delete[] (void*); // ERROR: return type should be void };
Message ID: badoprtype
The parameter in the constructor or operator is not allowed. Example of code that generates the error message:
class A { void operator delete[] (long* ); // ERROR: long* should be void* A(A); // ERROR: the parameter in a copy constructor must be a reference to class type };
Message ID: badoptypes
(Kernigan and Ritchie) An argument is declared but is not defined in parameter list Example of code that generates the error message:
void foo (a,b) int a; char b; long d; // Error: d is not defined in parameter list {}
Message ID: badparamerr
The overloaded postfix binary operator must take an int argument. Example of code that generates the error message:
class B { B operator++(); // prefix ++b B operator++(float); // postfix b++, //ERROR: should be B operator++(int) };
Message ID: badpostfix1
The second argument of the postfix operator must take an int value. Example of code that generates the error message:
template<class T> T operator ++(T &t, float); // ERROR: change float to int.
Message ID: badpostfix2
The preprocessor directive is not recognized. Check the spelling. Example of code that generates the error message:
#bad_directive
Message ID: badppdir
A constant expression in a preprocessor directive was expected but not found. Example of code that generates the error message:
#if 0xkl0 // ERROR: Badly formed constant expression. #fi
Message ID: badppexpr
Simple types such as int, float, and char do not have destructors. Example of code that generates the error message:
int main() { int *i = new int(0); i->int::~int(); // ERROR: use "delete i" instead }
Message ID: badpseudodestr
Only virtual functions may be declared pure. Example of code that generates the error message:
class A { A() = 0; // ERROR: A::A() is not virtual but is declared pure virtual void foo() = 0; // ok };
Message ID: badpuref
A pure function requires that the function be declared virtual and set equal to 0. Any other syntax will generate an error. Example of code that generates the error message:
class A { A() = 0; // ERROR: A::A() not virtual virtual void foo() = 1; // ERROR: "1" should be "0" void foo() = 99; // ERROR: A::foo() not virtual virtual void foobar() = 0; // ok };
Message ID: badpuresyn
The second and third operands for "?:" are incompatible and cannot be converted.
void foo() { int *x; int y; int i = (1 == 4 ) ? x : y; // ERROR }
Message ID: badquesttypes
The floating constant is invalid. It is too large and will overflow, or does not have valid characters following the number (F, f, L, or l). Example of code that generates the error message:
float i = 123.34f; // ok float j = 987.2g; // ERROR
Message ID: badreal
reinterpret_cast is not allowed. Example of code that generates the error message:
struct B { int j; }; struct A: B { int i; }; void foo() { B *b = new A; A *a1 = new A; int *i = (int*)a1; int j = reinterpret_cast<int> (*a1); // ERROR: cannot convert a1 to an int a1 = (A*)i; // ok, pointer types b = (B*)a1; // ok a1 = (A*)b; // ok }
Message ID: badreintcast
The function returns a different type than the one specified by the function declaration. Example of code that generates the error message:
class A{ A foo() { char a = 'c'; return a; } };
Message ID: badreturn
An unexpected ")" was encountered. Example of code that generates the message:
int main(){ int i; ); // ERROR: unmatched right parenthesis
Message ID: badrparerr
A static cast is legal only where there is an implicit conversion from one type to another. Example of code that generates the error message:
struct A { operator int(); } a; struct B {} b; void foo() { int i = 3; double d = 3.14159; i = d; // ok i = static_cast<int> (d); // ok static_cast<A> (i); // ERROR static_cast<B> (a); // ERROR int(a); // ok, conversion from type A to int provided static_cast<int> (a); // ok };
Message ID: badstaticcast
The member function cannot be declared static. Example of code that generates the error message:
#include <iostream.h> class A { static A foo(); // ok // The following are errors: static A(); static A( int i, int j ); static ~A(); static A operator+(A a); static istream& operator>>(A& a); };
Message ID: badstatmf
A function cannot be declared both virtual and static. Example of code that generates the error message:
class A { static virtual void foo(); }; class C { virtual void foo(); }; class D: C { static void foo(); // ERROR };
Message ID: badstatvirtf
The character escape sequence used in the string is not defined. Example of code that generates the error message:
void foo() { char *a = "Hello World!\i"; // ERROR: "\i" undefined }
Message ID: badstring
The character literal is too large a value to fit into a char type. Example of code that generates the error message:
char c = '\xabc'; int i = '\xabcdefg';
Message ID: badstringcon
Addresses of array elements and names or addresses of non-static class members are illegal template-arguments. A template argument must be an integral constant, or a pointer or reference to an external variable. Example of code that generates the error message:
template<int* p> class X { }; int a[10]; struct S { int m; static int s; } s; X<&a[2]> x3; // error: address of array element X<&s.m> x4; // error: address of non-static member
Message ID: badtemparg
The argument to the template reference parameter must be an externally named object. Temporaries or unnamed lvalues are illegal. Example of code that generates the error message:
template <int &i> struct A { int &j; A(); }; int j = 9; void foo( int i ) { A<i> a1; // ERROR: i is a temporary extern int x[3]; A< x[1] > a2; // ERROR: Address of array element is illegal // for template parameter. extern int x; A<x> a3; // ok A<j> a4; // ok };
Message ID: badtmplrefarg
The template parameter type must be an integral type.
Message ID: badtemppar
The operand to the unary operator must be an lvalue. Example of code that generates the error message:
void foo() { const int x = 7; x++; // ERROR int j = --9; // ERROR }
Message ID: badunaryop
Only non-static member functions are allowed to use this. Example of code that generates the error message:
class A { int j; public: static void foo() { this.j = 20*j; } // ERROR void foobar() {this.j = 21*j; }; // ok };
Message ID: badthis
The type specifier is not allowed at this location.
Message ID: badtypeerr
The derived class has a virtual function with a different return type specified by the function in the base class. Example of code that generates the error message:
class Base { virtual void foo(); }; class A: Base { int foo(); // ERROR: should return void };
Message ID: badvirttype
Too many bits specified for a bitfield. Most likely, the type of a bitfield is too small to have specified number of bits. Example of code that generates the error message:
struct tag { char a: 32; // Warning: char is too small to have 32 bits } t;
Message ID: bfbigger
The declared bit field is too large. The size of the bit field is machine dependent. Example of code that generates the error message:
static union { int a:33; // ERROR: Bit fields may be no longer than 32 bits (on this machine) };
Message ID: bftoobig
Bit fields cannot be defined with less than a one-bit size. Example of code that generates the error message:
class A { int a:0; // ERROR: Bit fields must contain at lest one bit };
Message ID: bftoosmall
Most likely, an attempt was made to assign member function pointer to a function pointer. Example of code that generates the error message:
class A { public: A () { } int goo (); }; int main () { A a; int (*foo) (); // The following declaration should be used instead: // int (A::* foo) (); foo = a.goo; }
Message ID: boundfuncaddr
Taking the address of a constructor is illegal. Example of code that generates the error message:
struct A { A(); }; void foo() { const int &i = A::A; // ERROR: cannot take address of a constructor }
Message ID: cantaddrcon
Taking the address of a destructor is illegal. Example of code that generates the error message:
struct A { ~A(); }; void foo() { const int & i = A::~A; // ERROR: cannot take address of a destructor }
Message ID: cantaddrdest
You are attempting to reassign a value of the left operand which was declared const and cannot be modified. Example of code that genreates the error message:
const int i = 7; int j = 9; void foo () { i = j; // ERROR: The left operand cannot be assigned to }
Message ID: cantassign
The operand cannot be modified. Constant values, array names, and functions cannot be assigned. Examples of code that generates the error message:
int i = 7; int *const pi = &i; int j[5]; j = 9; void foo() {} void goo() { foo = 5; // ERROR: The operand "*foo" cannot be assigned to. pi = &i; // ERROR: The operand "pi" cannot be assigned to. }
Message ID: cantassignop2
Strings of wide character type and strings of character type cannot be catenated. Example of code that generates the error message:
char str [] = "abcdefhg" L"hijklmnop";
Message ID: cantcatstring
This error is issued by the compiler when too many errors are detected to continue debugging the program.
Message ID: cantgoon
The overloaded operator specified was not found. This error can also be generated if the type of the operator has not yet been defined. Example of code that generates the error message:
#include <stddef.h> class A { void* operator anew[] (size_t); // ERROR: operator "anew" does not exist void operator delete[] (void*); };Example of an operator declared for an undefined type:
class B { operator C(); // ERROR: the type C has not yet been defined }; class C {};
Message ID: cantoverop
An overloaded function has a different address for each definition. Taking the address is ambiguous and is an error. Example of code that generates the error message:
int foo() {return 1; } int foo(int i) { return 0; } int main() { const int & i = foo; // ERROR const int & j = foo; // ERROR return 0; }
Message ID: cantuseover
There was an attempt to cast away constness. Example of code that generates the error message:
class B { virtual void foo(); }; class A: public B {}; const B * pb = new A; A *pa1 = dynamic_cast<A*>(pb); // ERROR: dynamic_cast casts const pb to a non-const pointer. int j = 4; const int *c = &j; int *i = reinterpret_cast<int*>(c); // ERROR
Message ID: xcastawayconst
This error is currently not implemented. If a cast is from a struct that is incomplete and is not void, then this error is issued.
Message ID: castfrominc
This error is currently not implemented. If a cast is to a struct that is incomplete and is not void, then this error is issued.
Message ID: casttoinc
Exception handlers may not have a default parameter. Example of code that generates the error message:
int main () { int i = 3; try { if (i < 100) throw 100; } catch (int j = 1000) // ERROR { i += j; }; }
Message ID: catchdef
This warning generated in the case if a handler of the derived class placed after its base class handler. The second case will never catch an exception. The first case will match exceptions for instances of the base class and instances of the derived class. Example of code that generates the error message:
class A { public: int i; A() { i = 1; } }; class B: A { public: int j; B() { j = 2; } }; int main () { A a; B b; try { if ( b.j != 3) throw a; if ( a.i != 2) throw b; } catch (A anA) // catches A and B exceptions { a.i = anA.i + 1; } catch (B anB) { // Warning: handler never reached b.j = anB.j + 1; }; }
Message ID: catchderive
There was more than one exception handler after try. Example of code that generates the warning message:
int main () { int i = 3, j = 4; try { if ( i == 3 || j == 4 ) throw 5; } catch (int x) { i = x + 1; } catch (double z) // ok { i = j = i + j; } catch (int y ) // ERROR: Duplicate exception handler, same type { j = 2; }; }
Message ID: catchdup
A handler may only have one exception. Example of code that generates the error message:
int main() { int i = 3; double j = 4; try { if ( i != 3 ) throw 3; if ( j != (double)4 ) throw (double)4; } catch ( int x, double y ) // ERROR: Multiple exceptions for a handler { i = 3; j = 4; } return 0; }
Message ID: catchmularg
The handler must have one exception. Example of code that generates the error message:
int main() { int i = 3; try { if ( i != 3 ) throw 3; } catch ( ) // ERROR: No exception for a handler { i = 3; } return 0; }
Message ID: catchnoarg
try must have at least one exception handler. Example of code that generates the error message:
int main () { int a = 107; try { if (a > 2000) throw 2000; if (a < 100) throw 100; throw a / 3; } // ERROR: No catch }
Message ID: catchnosym
Once a default parameter value has been specified, it cannot be redefined. Example of code that generates the error message:
void foo( int i, int j = 7 ); // j has default value 7 int main() { return 0; } void foo( int i, int j = 9 ) {} // ERROR: j has been defined to have default value to 7
Message ID: changedef
The length of the character constant exceeds the maximum storage space of a char. Only the first four characters of a regular character constant, an only the first character of a wide character constant are used. Character constants longer than one character are nonpoartable. Example of code that generates the warning message:
char c = '9999'; // ok char ch = '12345'; // ERROR
Message ID: chartoolong
An object previously defined as a class or struct type cannot be redefined as a union. Example of code that generates the error message:
class A { int i; }; union A { // ERROR int i; long j; };
Message ID: cltounion
An object defined as a union type cannot be redefined as a class or struct type. Example of code that generates the error message:
union A { int i; long j; }; class A { int i; };
Message ID: clfromunion
(C mode) In C, declarations are not allowed to be mixed with statements. Example of error that generates the error message:
void foo () { int a = 0; a++; int c; // Error: declaration is not allowed here }
Message ID: declplaceerr
Vector of classes must use only the default constructor. Example of code that generates the error message:
class A { A() {}; }; typedef A B[5]; void foo() { B b(1, 2, 3, 4, 5); }; // ERROR
Message ID: defaultonly
Type definition within a condition expression is illegal. Example of code that generates the error message:
int main () { for (int i = 0; struct t {}; j++) // Error: 'struct t' couldn't be defined here ; }
Message ID: defincond
The destructor of the class is private or protected and is not accessible from here. Example of code that generates the error message:
class A { private: ~A(); public: char *ch; A(); }; void foo() throw(A) { throw A(); // ERROR: destructor is not accessible } int main () { foo(); }
Message ID: destnotacc
The same function has been declared to return two different types. Example of code that generates the error message:
void foo(); int foo(); // ERROR: foo() previously returned void.
Message ID: difreturns
The compiler has determined that the evaluation of the floating point division expression will overflow.
Message ID: divfovfl
The compiler has determined that an integral value is being divided by zero and will overflow. Example of code that generates the error message:
int i = 1/0;
Message ID: divovfl
There was an attempt to divide by zero, and the result is left to be handled at runtime. Example of code that generates the warning message:
int i = 9; int j = i/0;
Message ID: divovflnv
There are two default statements in the current switch statement. Example of code that generates the message:
f(void){ long i = 5; switch(i) { case 1: case 2: break; default: default: // ERROR: too many default statements } }
Message ID: doubdefault
The use of two consecutive underbars is a warning. The name may conflict with the internal names of compiler-generated code.
Message ID: doubunder
The access of the base class may be specified only once. Example of code that generates the error message:
class B {}; class D: public private protected B {}; // ERROR class G: public public {}; // ERROR
Message ID: dupaccess
A base class may be included only once. Example of code that generates the error message:
struct A2 { int i; }; struct A { int i; }; struct A2 { int i; }; struct B: A, A2, A { // ERROR: the base class A was included twice B() { A::i = 7; }; };
Message ID: dupbaseclass
There are two case statements in the current switch statement that have the same constant value. Example of code that generates the error message:
f(void){ long i = 5; switch(i) { case 4: case 4: break; } }
Message ID: dupcaselabel
The member has already been initialized previously in the constructor initializer list. Example of code that generates the error message:
class A { int i; A(): i(0), i(0) { // ERROR: duplicate initialization of member i } };
Message ID: dupinit
The result of a dynamic cast must be a pointer or reference type. Example of code that generates the error message:
class B { virtual foo(); }; class D: public B { int i; }; B *pb = new D; D *pd1 = dynamic_cast<D>(pb); // ERROR, the cast does not result in a pointer or reference D *pd2 = dynamic_cast<D*>(pb); // ok
Message ID: dynbadtype
A pointer or reference to a polymorphic type is required in the dynamic_cast operand. The type does not have at least one virtual function. Example of code that generates the error message:
class B {}; class D: public B {}; B * pb = new D; D *pd = dynamic_cast<D*>(pb); // ERROR: class B does not have a virtual function
Message ID: dynnotpolym
The result expected is a reference, but the operand is not a reference, a pointer, or a structure type. Example of code that generates the error message:
class B { virtual void foo(); }; class D: public B {}; B *pb = new D; int &c = int j; D *pd1 = dynamic_cast<D&>(pb); // ERROR: The operand pb is a pointer D *pd2 = dynamic_cast<D&>(c); // ERROR: c is not a structure type
Message ID: dynnotref
The operand of the dynamic_cast was expected to be a pointer type. Example of code that generates the error massage:
class B { virtual foo(); }; class D: public B { int i; }; B *pb = new D; D d; D *pd1 = dynamic_cast<D*>(d); // ERROR: d was expected to be a pointer type D *pd2 = dynamic_cast<D*>(pb); // ok
Message ID: dynnotptr
The target result of the dynamic cast is not a pointer or reference to a class. Example of code that generates the error message:
class B { virtual void foo(); }; class D: public B { }; B *pb = new D; D *pd1 = dynamic_cast<int*>(pb); // ERROR: dynamic_cast should specify the type "D*"
Message ID: dynnotclass
The operand does not point to a class type. Example of code that generates the error message:
class B { virtual void foo(); }; class D: public B {}; int *c = int j; D *pd = dynamic_cast<D*>(c); // ERROR: c points to an int
Message ID: dynbadopnd
More than one object was declared with the same name. Example of code that generates the error message:
int i; float i; // ERROR typedef int I //. . . int I; // ERROR
Message ID: multdecl
The base class has already been initialized. Example of code that generates the error message:
class B { int i; B() { i = 0; }; }; class A: B { int i; A(): B(), B() { // ERROR: Base class initialized again. } };
Message ID: dupbaseinit
Example of code that generates the error message:
int const int i = 9; const float const j = 3;
Message ID: duptypeerr
A function may be defined only once. Example of code that generates the error message:
void foo() { int i; } int main() { /* code */ } void foo() { int i; } // ERROR, foo() defined twice
Message ID: dupfuncdef
There are too many virtual declarations for the base class. The base class needs only one virtual declaration. Example of code that generates the error message:
class B {}; class D: virtual public virtual B {}; // ERROR: too many virtual declarations.
Message ID: dupvirtspec
"catch(...)" must be the last handler of the exception handler blocks. Example of code that generates the error message:
int main () { int i = 3; try { if (i < 100) throw 100; } catch (...){} // ERROR: move this catch to the last of the catch statements catch (int j) { i += j; }; }
Message ID: eliplaceerr
A character constant consisting of no characters has been used. Example of code that generates the message:
f(void) { char c = ''; // suggestion: char c = ' '; }
Message ID: emptychar
The code contains an empty declaration statement inside a namespace scope (which includes global and file scope). The most likely cause is an extra semicolon. Example of code that generates the message:
namespace { ; // ERROR }; class A { ; }
Message ID: emptydecl
The file is empty. This error occurs if the file is not compiled as a C++ file and the compiler is not in compatbility mode.
Message ID: emptyfile
The End of file was encountered before the end of a comment. Example of code that generates the error message:
/* message text . . . <EOF> // ERROR
Message ID: eofincomment
The compiler encountered the end of the file while skipping text. Check #if . . . #endif pairing. Example of code that generates the error message:
#if false // . . . #if unmatched with #endif // <EOF>
Message ID: eofskipping
The expression has exceeded the maximum number of operands and operators allowed by this compiler. Try breaking down the expression into smaller intermediate expressions.
Message ID: exprtoomuch
The parameter list should not end with a trailing comma. Example of code that generates the warning message:
void foo( int i, int j) {} int main() { foo(1,2,); // ERROR return 0; }
Message ID: extracomma
A member can only be initialized in a constructor. Example of code that generates the error message:
struct A { int i = 9; // ERROR int j = 4; // ERROR }; class B { int k; B() { k = 7; } // ok };
Message ID: fieldinit
The function in the derived class hides the function in the base class. Example of code that generates the warning message:
class A { public: int foo(int); }; class B: A { public: virtual int foo(char *i); };
Message ID: hidef
No ordinary operator delete was found in scope. Most likely, operator delete was illegally overriden in class scope. Example of code that generates the error message:
#include <new> template<class t_arg> class A { public: void operator delete(void*, const std::nothrow_t&) throw(); // ERROR: delete(void*) is hidden, // need to provide operator delete // with one parameter as well }; int main () { A<int> * a = new A<int>; }
Message ID: hideferr
A function in a derived class hides its counterpart in a base class. It usually happens if virtual function was redeclared in a derived class, and its prototype does not match that that was specified in a base class. Example of code that generates the error message:
class B { public: virtual int foo(int); // hidden by B::foo() }; class D: B { public: virtual int foo(char *i); // B::foo() hides virtual A::foo(int) };
Message ID: hidevf
Warning. A function is hiding a function in its virtual base class. Example of code that generates the warning message:
class B { void i; public: virtual int foo(int); // hidden by B::foo() }; class D: virtual B { public: virtual int foo(char *i); // Warning: B::foo() hides virutal A::foo(int) };
Message ID: hidevfinvb
The name is unusable as a default parameter in the current context. Example of code that generates the error message:
void foo () { int a; class A { public: void goo (int b = a) {} // ERROR: a is unusable here }; }
Message ID: identundef
The name cannot be used in the specified context. Example of code that generates the error message:
void foo () { int a; class A { public: void goo () { int k = a; // ERROR: a is unusable here } }; }
Message ID: identunnestf
Only a non-static member function may use this name. The member variable is not static. Each instance of the type will have its own copy. Example of code that generates the error message:
struct A { int i; }; struct B: A { public: int i; static int j; void foo() { B::i = 2; } // ok static foobar() { i = 2; } // ERROR: "foobar()" is static, but "i" is not }; void foobar() { A a; A::i = 7; // ERROR: A::i not static B::j = 3; // ok a.i = 7; // ok }
Message ID: identunstat
Defining a type within a cast expression is illegal. Example of code that generates the error message:
int i; float j = ( class A{} ) (i);
Message ID: illegalcast
An attempt was made to directly access private members in a class. Example of code that generates the error message:
class A { int i; // private data member }; void foo() { A a; a.i = 9; // ERROR: Error: i is not accessible from foo() } class T { T(const T&); // private copy constructor }; void foo( T t ) {} // ERROR: cannot pass a T, copy constructor is private T f2() { T t; return t; } // ERROR: cannot return a T
Message ID: inaccessible
The type has not been defined correctly, or no storage has been allocated. Example of code that generates the error message:
class C; void f () { new C; // ERROR: The type C is incomplete }
Message ID: incomplete
The type used in delete still has not been defined. Example of code that generates the error message:
class A; int main () { A * a_ptr = 0; delete[] a_ptr; // WARNING: The type A, used in delete, is incomplete }
Message ID: incompletew
A variable of a different type has the same name as a variable with external linkage. Example of code that generates the error message:
extern int i; float i; // ERROR
Message ID: incomtype
(Kernigan and Ritchie): Function overloading is not allowing in Kernigan and Ritchie mode. Example of code that generates the error message:
int foo (char); int foo (float); // ERROR: overloading is not allowed in KnR
Message ID: incomtypef
A union cannot have a member that requires initialization or destruction Example of code that generates the error message:
class A { public: A(); }; union { A a; // ERROR: A union member cannot require initialization or destruction } un;
Message ID: initnotall
Function cannot be defined inline since it has already been called and its declaration did not contain inline keyword. Example of code that generates the error message:
class A { public: void foo (); }; int main () { A a; a.foo(); } inline void A::foo () {}
Message ID: xinlafteruse
The function is too large for the compiler to be generatedbe generated inline.
Message ID: inllargeuse
The function is too large for compiler to generate automatically. You can still manually inline the function.
Message ID: inllargeint
A label was used, but was not defined. Example of code that generates the error message:
int main() { //. . . goto label1; // ERROR: "label1" was never defined //. . . return 0; }
Message ID: labelundef
Static members cannot be declared in a local class. Example of code that generates the error message:
void foo() { class A { static int i; }; }
Message ID: lcstatic
You must define a body for a local class's virtual member functions. Example of code that generates the error message:
int main () { class inner_class { public: virtual int foo (); // ERROR virtual int goo () {} // ok }; }
Message ID: lcfnodef
The storage classes auto and register may only be used in a block for a function argument. Example of code that generates the error message:
register int a = 3; // ERROR auto float b = 3.14159; // ERROR void foo( auto int i, // ok register j ) // ok { register int x = 3; // ok auto int y = 4; // ok }
Message ID: locstorespec
The linkage specification was not used at the file level. Example of code that generates the error message:
extern "C" int k; //ok void foo() { extern "C" int i; // ERROR extern "C" int j; // ERROR };
Message ID: loclinkage
A line separator is not allowed in string and character constants. Example of code that generates the error message:
char c = ' '; // ERROR: has line seperator.
Message ID: longstring
Macros cannot be redefined to a different value without an intervening #undef. Example of code that generates the error message:
#define count 1 #define count 2 // ERROR: Attempt to redefine count without using #undef.
Message ID: macroredef
This macro has exceeded the maximum number of parameters allowed by this compiler.
Message ID: manymacroparms
There are two or more macro parameters with the same name. Parameter names must be unique. Example of code that generates the error message:
#define foo( X, X )
Message ID: dupmacroparms
The called overloaded function is ambiguous. Example of code that generates the error message:
void foo (int i, int j); void foo (int i = 3, int j = 7);// ok: redeclaration of foo(int, int) void foo (); // ok: overloaded declaration of foo int main() { foo (1, 2); // ok: call f(int, int) foo (); // ERROR: call f(int,int) or f()? }Ambiguity may also arise from use of constructors and conversion operators:
struct A { A(int); }; struct B { B(int); operator int(); operator double(); } b; A foo( A a ); B foo( B b ); int main() { foo(1); // ERROR: foo(A) or foo(b)? } int i = b; // ok: conversion of B to int matches float f1 = b; // ERROR: call int or double operator? float f2 = double(b); // ok: conversion operator specified.
Message ID: manymatchover
The class member cannot be declared outside the class. Example of code that generates the error message:
class A { public: void foo(); }; void A::foobar(); // ERROR: illegal declaration of member outside the class
Message ID: membnotall
The function is declared to return a value but has returns with and without values. Example of code that generates the warning message:
int foo() { int i = 9; if ( i == 1 ) return; // ERROR: foo() expected to return a value else if ( i == 2 ) return 8; // Warning: There are returns from foo() with and without values else if ( i == 3 ) return 1; // Warning else if ( i == 9 ) return; // ERROR else return 1; // Warning };
Message ID: mixedreturns
There was an attempt to compute a remainder with zero. Example of code that generates the error message:
int i = 1000000 % 0;
Message ID: modovfl
There was an attempt to compute a remainder of a variable with zero. The handling of this warning is left to runtime. Example of code that generates the warning message:
void foo() { int i = 9; i%0; // Warning: computing remainder with zero }
Message ID: modovflnv
The floating point multiplication expression was determined by the compiler to overflow. Handling of this error is deferred to runtime.
Message ID: mulfovfl
The compiler attempts to compute the result of a multiplication at compile-time, and determines that the result overflows. The low-order 32 bits of the result are retained, and the compiler issues this diagnostic. Example of code that generates the message:
int i = 1000000 * 1000000;
Message ID: mulovfl
Multiple qualifiers are not allowed.
Message ID: multqualerror
The class is not a direct base class. The members of the class cannot be used by a base class directly. Example of code that generates the error message:
struct B { int j; void foo() { /* B::foo() */ }; }; struct A: B { // B is the base class of A int i; void foo() { /* A::foo() */ }; }; A *pa; B *pb; A a; B b; int main() { pa = &a; pb = &b; pa->B::foo(); // ok pb->::foo(); // ERROR: A::foo() cannot be accessed by pointer type B // of the base class return 0; }
Message ID: mustbebase
The operator declared must be a member function. The following operators must be defined as a member: "=", "->", "{", "()", and type conversions. Check if the scope operator is missing in the operator definition. Examples of code that generates the error message:
class B { int i; operator =(const B&); }; B::operator =(const B &b){ return (this->i + b.i); }; // ok, defined as member // The following will generate errors: B operator ->(); B operator {(); B operator ()(); B operator int();
Message ID: mustbemem
A function cannot return an array of functions. Example of code that generates the error message:
void foo[3] (); // ERROR
Message ID: noarroffunc
An array of references is not allowed. Example of code that triggers the error message:
int main() { int &j; // ok int &i[3]; // ERROR }
Message ID: noarrofref
This class is not a derived class, and cannot initialize a base class. Example of code that generates the error message:
class A { int i; A(): (10) {}; };
Message ID: nobaseclass
The statement is missing an "=". Example of code that generates the error message:
void foo() { if ( const int i 2 ) // ERROR: there is a missing "=" after i ; }
Message ID: nobecomeserr
Taking the address of a bit field is illegal. Example of code that generates the error message:
struct A { int i:3; int j:4; int k:5; int foo() { return &i; } // ERROR: };
Message ID: nobitaddr
A reference to a bit field is illegal. Example of code that generates the error message:
struct A { int i:3; int j:4; int k:5; int &foo() { int &ri = i; return ri;} // ERROR };
Message ID: nobitref
There was an attempt to access an object or function that is not a member. Example of code that generates the error message:
void foo() {} void foobar() {} class A { public: int i; int j; friend void foo(); }; void A::goo() {}; // ERROR: goo is not a member of A int main() { A a; a.i = 0; // ok a.foobar(); // ERROR: foobar is not a member of A a.foo(); // ERROR: foo is a friend but is not a member of A }
Message ID: nofieldfnd
There is a syntax error. Example of code that generates the error message:
void foo() { int i = 0; switch (i) { case 3: case 4; // ERROR ":" expected instead of ";" i++; break; }; };
Message ID: nocolonerr
A ":" is expected following a "?". Example of code that generates the error message:
int main() { int i= -7; i = ( i < 0 ) ? -i i; // ERROR: ":" expected following "?" }
Message ID: nocolonop
There is a syntax error in your code. Examples of code that can generate the error message:
int foo( int i; int j) // ERROR: ";" should be "," { return i*j; } struct A { int k; } a, aa: // ERROR: "," followed by declaration is expected OR ":" should be ";"
Message ID: nocommaerr
You have used the compiler argument -noex to ignore throw.
Message ID: noexthrow
You have used the compiler argument -noex to ignore try and catch exception structures.
Message ID: noextry
The identifier list has an end of line before the list was terminated with a ")". Macros should be defined on one line. Is a "\" missing? Example of code that generates the error message:
#define foo( A, // Missing "\" B )
Message ID: noidentlist
const member objects should be initialized.
Message ID: noconstinit
There is no way to provide an initializer while allocating an array with operator new[]. Example of code that generates the error message:
class A { public: A (int k=0) {} }; int main () { A * ptr = new A[2](3); // ERROR: there is no need to provide \'3\' as initializer }
Message ID: noconstrparm
The class definition must end with a semicolon or declarations followed by a semicolon. Example of code that generates the error message:
struct A { int i; } a, :
Message ID: nodeclerr
The declaration does not specify a storage class or type. Example of code that generates the error message:
class A { i; // ERROR: No storage class or type };
Message ID: nodeclspec
Default parameter values on overloaded operators or on pointers to functions are not allowed. Example of code that generates the warning message:
class T { int i; public: T(int j); }; T operator+ (T t, T t2= T(0) ); // ERROR: you cannot have default parameter values in overloaded operators. void (*fptr)(int k = 3); // ERROR: you cannot have default parameter values in pointers to functions
Message ID: nodefall
You cannot define any types within operator new. Example of code that generates the warning message:
int main () { void * t = (void *) new (struct t {}); // ERROR: struct declaration in operator new // encountered. }
Message ID: nodefinnew
Functions cannot define a type in the arguments of a function. Example of code that generates the error message:
class A { A(); friend void foo( class B{} b;); };
Message ID: nodefinproto
A type definition couldn't be used in the return type specification. Example of code that generates the error:
struct t{} foo () { // Error: 'struct t' couldn't be defined here }
Message ID: nodefinret
You cannot define a new type within a "sizeof" expression. Example of code that generates the error message:
int foo () { return sizeof (struct t {}); // ERROR: struct declaration in sizeof expression found }
Message ID: nodefinsizeof
You cannot define a new type within a "typeid" expression. Example of code that generates the error message:
#include <typeinfo> int main () { typeid (struct t {}); // ERROR: struct declaration in typeid expression found }
Message ID: nodefintypeid
The use of a count in the "delete []" operator is obsolete. Remove the count. Example of code that generates the warning message:
void foo() { int *i = new int[10]; delete [10] i; // ERROR: use of count in "delete []" }
Message ID: nodelno
Syntax error. A direct declarator is missing before this token. Example of code that generates the error message:
int () {}; // ERROR: function name missing struct A { static int i; static int j; }; void foo() { A::i = 7; //ok A:: ; // ERROR: missing variable int []; // ERROR missing array name }
Message ID: nodirdecl
RTTI has been disabled, and dynamic casting is replaced with static casting.
Message ID: nodyncast
A syntax error encountered after the keyword enum. Example of code that generates the error message:
class A { enum A = { x, y, z } };
Message ID: noenumerr
An expression was expected but was not found. Example of code that generates the error message:
int j =; int k = {}; int l[] = {}; if ( );
Message ID: noexprerr
You tried to reference a nonexistent member of a class, structure or union. Example of code that generates the error message:
struct { // The following field should be defined: // int a; } t; int main () { return t.a; }
Message ID: nofieldident
The friend declaration did not have a class or function specified. Example of code that generates the error message:
class A { int i; friend; };
Message ID: nofriendfield
Anachronism. Class friends require an explicit "class". Example of code that generates the warning message:
class A { int i; friend B; // Warning: should be "friend class B" }; class B { int j; };
Message ID: nofriendw
A function cannot be declared as a structure member in Kernigan and Ritchie compatibility mode. Example of code that generates the error message:
struct { int foo () { return 0; } // ERROR } t; int main () { return t.foo(); }
Message ID: nofunchere
Template and cast parameter lists must have "<" matched with ">". Example of code that generates the error message:
class B { virtual void foo(); }; class A: public B {}; int main() { B * pb = new A; A *pa1 = dynamic_cast<A*(pb); // "A*" should be immediately followed by a ">" }
Message ID: nogtrerr
An identifier was expected. Example of code that generates the error message:
void foo() { int float j; // ERROR: identifier expected after int int; // ERROR goto; // ERROR }
Message ID: noidenterr
(Kernigan and Ritchie, Ansi mode): an identifier was expected. Example of code that generates the error message:
void foo() { int; // ERROR }
Message ID: noidentwarn
const values that are not external symbols must be initialized. Example of code that generates the error message:
const int *pj = new int(0); //ok int a = 10; const int i; // error const int &j; // error const int &k = a; // ok }
Message ID: noiniterr
(Kernigan, Ritchie): const values that are not external symbols should be initialized. Example of code that generates the error message:
int main () { static const int a; // WARNING: a should be initialized }
Message ID: noinitwarn
A const object created with the new() operator must be initialized either with an initial value, a constructor, or an initializer. Example of code that generates the error message:
const int *ip = new const int; // ERROR const int *jp = new const int(0); // ok
Message ID: noinitanac
A body was not defined for an inline function. Example of code that generates the message:
inline void foo(); // ERROR: no function body is defined to inline foo() int main() { foo(); return 0; }
Message ID: noinlbody
The reference member must be initialized before it is used. Example of code that generates the error message:
class A { public: int &i; }; void foo() { A a; a.i = 7; // ERROR: "a.i" has not yet been initialized. int j; a.i = j; a.i = 7; // ok }
Message ID: noirefmem
A statement (even if empty) is required after a label. Example of code that generates the message:
main() { int i = 10; switch (i) { case 1: default: i++; break; case 2: // ERROR: label has no statement after "case 2" } }
Message ID: nolabstaterr
There is an error in the syntax. Example of code that can generate the error message:
void foo() { int i[] { 1, 2, 3, 4, 5 } } int main() int i; // ERROR: a "{" was expected instead of "int" { return 0; } int foo() { int m[] = 5; // ERROR: "{" expected instead of "5" int n[] = { 2, 3, 5 }; // ok } class A { int i; public: A(): i(10); // ERROR: constructor should be defined A(): i(10) {}; // ok };
Message ID: nolcurlerr
The value being returned as a reference to a local variable or temporary may not be available outside the scope of the function. Example of code that generates the error message:
int &foo(int i) { return i; // ERROR } int &foobar(int &i) { return i; // ok }
Message ID: nolocalname
Returning a reference to a bit field is not allowed. Example of code that generates the error message:
struct A { int i:3; int j:4; int k:5; int &foo() { return i; } // ERROR: cannot return a reference to a bit field };
Message ID: noretbitref
namespaces cannot be defined in a local scope. Example of code that generates the error message:
namespace names { //ok int j; int k; }; void foo() { namespace ns { // ERROR: namespace is in local scope int i; }; ns n; n::i++; }
Message ID: nolocalns
(ccfe): -nocx option prohibits using of both long long and long long const. Example of code that generates the error message:
long foo () { return 0ll; } // ERROR with -nocx option
Message ID: nollconst
(ccfe): -nocx option prohibits use of both long long and long long const. Example of code that generates the error message:
long long cll = 0; // ERROR with -nocx option
Message ID: nolonglong
bit fields of type long long are not allowed. Example of code that generates the error message:
class a { long long a:7; // ERROR: long long bit fields are not allowed int b:4; };
Message ID: nollbitfield
"(" was expected in the expression but was not found. Example of code that generates the error message:
int i; for i = 0; i < 7; ++i ) {} // ERROR: "(" expected instead of "i" if i < 7); // ERROR
Message ID: nolparerr
This error can be caused by a missing "<" in the cast expression or in the template. Example of code that generates the error message:
class B { virtual void foo(); }; class A: public B {}; B *b = new A; A *a = dynamic_cast A*>(b); template class T> class D{};
Message ID: nolsserr
The base does not have a matching constructor to initialize the class. Example of code that generates the error message:
class B { public: int i; //B(); B(int x) { i = x; } }; class A: B { A() { // ERROR: base class default constructor B::B() not found } };
Message ID: nomatchbase
An object in the class does not contain a matching constructor for the call. Example of code that generates the error message:
class B { public: int i; //B(); B(int x); // constructor supplied, no default constructor will be generated by compiler }; class A { B b_in_A; // not initialized int i; A(int x) { // ERROR: default constructor B::B() not found to initialize member b_in_A i = x; B(1); } };
Message ID: nomatchmem
A match of the function call among the overloaded functions and/or templates could not be found. Example of code that generates the error message:
struct S { int &r; }; int main() { struct S *x = new S(0); // ERROR: constructor S::S(int) not found };
class A { public: int i; A(); A(int a, int b); }; void foo(){ A a(1,2,3); // ERROR: passing three arguments to constructor, no match }
Message ID: nomatchover
Every left parenthesis must have a matching right parenthesis. Example of code that generates the error message:
int foo( // ERROR: There is no matching ")" { int i = 3; reutrn 0; }
Message ID: nomatchrpar
References and function types cannot be allocated with the new operator. Example of code that generates the error message:
int main () { new (int&); // ERROR: attempt to allocate a reference with new }
Message ID: nonewtype
The base class does not have a default constructor defined. If the base class has a constructor defined, a default constructor is not generated by the compiler.
struct A { A(int); }; struct C: A {}; C c; // ERROR C c1(); // ok, default constructor generated by compiler
Message ID: nonulconbase
A member of a struct type does not have a default constructor, or a default constructor was not generated by the compiler because the contained type had at least one constructor supplied. Example of code that generates the error message:
struct B { int i; B(int x); }; struct A { B b_in_A; // A does not have a default constructor. }; A a; // error flagged here
Message ID: nonulcon
The default constructor was not generated or defined. The vector could not be initialized. Example of code that generates the error message:
class A { public: int i; //A(); A(int); }; A *a = new A[8]; // ERROR
Message ID: nonulvec
A const object has called a member function that has not been declared const. Example of code that generates the error message:
class A { public: A(); int foo(int i) {return i;} }; void bar() { const int i = 7; A const a; a.foo(i); }
Message ID: nonconmf
A const object has called a member function that has not been declared const.
Message ID: nonconmfp
The function returns a reference value, but a non-lvalue has been returned. Example of code that generates the error message:
int &foo() { return 0; }
Message ID: nonvarref
It is impossible to cast a non-lvalue to the specified type.
int main () { const_cast<int&>(0); // ERROR: cannot cast non-lvalue to int& }
Message ID: nonlvalcast
The function cannot return a value because the declared function return specification is void. Example of code that generates the error message:
void foo() { int i = 3; return i; // ERROR: the return type of the function is void, not int }
Message ID: nonvoidret
An object declared to be volatile may only call a volatile function. Example of code that generates the error message:
class A { public: void foo(); }; int main() { A volatile a; a.foo(); // ERROR: A::foo() is not a volatile function }
Message ID: nonvolmf
A member function must be declared volatile to be called by a volatile pointer. Example of code that generates the error message:
class B { public: void bar(); }; void (B::* b_ptr)(); int main() { B volatile *b; (b->*b_ptr)(); // ERROR: B::bar() is not declared volatile }
Message ID: nonvolmfp
Member functions should be called by an instance of the class with "." or "->". Example of code that generates the error message:
class A { public: void foo(){ /* code */ } }; int main() { A::foo(); }
Message ID: noobjcall
An operand was expected but was not found. Example of code that generates the error message:
void foo() { int i = 2; int j[5]; i = j[]; // ERROR: missing subscript i = [i]; // ERROR: should be j[i] double d = ()i; // ERROR: "()i" should be "(double)i" }
Message ID: nooprnderr
A pointer type cannot be subtracted from an integral type. Example of code that generates the error message:
void foo() { int i = 2; int *j = &i; i = i - j; }
Message ID: noptrsub
A pointer type of the object is required to access the member. Examples of code that generates the error message:
class A { public: int i; }; void foo() { A a; a->i = 8; // ERROR: "a" is not a pointer type }; void bar() { int j; j[0] = 7; // ERROR: "j" is not a pointer type }
Message ID: noptrvar
There is a syntax error for the array subscript. Example of code that generates the message:
int i[7]; i[6} = 10; // ERROR: "]" was expected
Message ID: norbrackerr
"}" was expected but was not encountered. Example of code that generates the error message:
int a [2] = { 1, 2 ; // Error, list of initializers should be terminated // with "}"
Message ID: norcurlerr
End of file was encountered before a matched "}" was found. Example of code that generates the error message:
void foo() { /* code */ <EOF> // error, "}" was expected, but EOF was encountered
Message ID: norcurleof
Typeid and dynamic casting is disabled if the flag -feature=no%rtti is set.
Message ID: nortti
A reference or pointer to a reference is illegal. Example of code that generates the error message:
const int &const &i = 12345678; // ERROR int i; int &ri = i; int &(*pri) = &ri; // ERROR
Message ID: noptrtoref
There was a declaration of a reference to void type. Example of code that generates the error message:
void &foo(); // ERROR: declaring a return value of reference to void type
Message ID: noreftotype
It is illegal to declare a reference to a member type that would enable access to private or protected class member data.
Message ID: noreftomem
A register has no address. This error is triggered when the program is not compiled as a C++ program and there was an attempt to take the address of a register. Example of code that generates the error message:
register int i = 3; int *pi = & i;
Message ID: noregaddr
There was a syntax error. A ")" token was expected in the expression. Examples of code that can generate the error message:
void foo() { int i = 3; switch (i // ERROR: ")" missing { case 2: i++; break; }; } void foobar( int i; float j ) // ERROR: "int i" should be followed by "," { if ( i = 9) // ERROR: "=" should be "==" i++;
Message ID: norparerr
Statements must end with ";" Example of code that generates the message:
int main() { int i; int j = 1; i = j + 3 // ERROR return 0; }
Message ID: nosemierr
Declarations must end with ";" Example of code that generates the message:
volatile int foo int goo ()
Message ID: nosemiheaderr
A statement (even an empty statement) is required here. Example of code that generates the error message:
void foo( int i ) { if ( i < 10 ) ++i; else // ERROR: missing statement }
Message ID: nostaterr
A static bit field is illegal. Example of code that generates the error message:
class A { static int i:4; // ERROR };
Message ID: nostaticbf
The variable is not an instance of a structure. Example of code that generates the error message:
int main () { int j; j.novar = 7; return 0; }
Message ID: nostructsym
The dot operator cannot be used on non-structure types. Example of code that generates the error message:
int main () { int().a; // ERROR: int is not a structure type }
Message ID: nostructype
The tag has already been used. Example of code that generates the error message:
typedef int A; class A {};
Message ID: nostructerr
A static member is shared by all instances of the object type. This member is not static; therefore, you must specify which one to use by using an instance of the object. Example of code that generates the error message:
struct A { int i; void foo() { A::i = 2; } //ok }; A::i = 7; // ERROR, i not static void foo() { A aa; aa.i = 7; // ok }
Message ID: notastatmem
A base class name was expected in the "using" directive. Example of code that generates the error message:
class t { public: int a; }; class A { using t::a; // ERROR: t is not a base class of A, cannot use t::a };
Message ID: notbase
Syntax error: integer constant expression required. Example of code that generates the error message:
int a; enum { mem1 = a, // ERROR: an integer constant expression is required here mem2, mem3 } e;
Message ID: notconst
An integer constant expression is required for a case label. Example of code that generates the error message:
int main() { int i = 0; switch (i) { case 4: // ok case 3.141592654: // ERROR i++; break; }; };
Message ID: notconstcase
The array subscript operator takes only an integer constant. Example of code that generates the error message:
int e[7]; e[2.718281828] = 5; // ERROR
Message ID: notconstsub
An integer constant expression is required for a bit field Example of code that generates the error message:
class A { int a:2; // ok int b:6; // ok int d:3.141592654; // ERROR };
Message ID: notconstbit
The compiler has encountered code that is only allowed in C++, and has issued this warning.
Message ID: notcpp
A typedef name cannot be used in enum and class types. Example of code that generates the error message:
typedef struct S T; struct T *p; // ERROR enum x { a, b } typedef enum x y; y x; // ok enum y x; // ERROR
Message ID: notdclass
A function definition cannot be a typedef'ed declaration. Example of code that generates the error message:
typedef int(mft)(int i); mft foo { // ERROR return i + 2; }
Message ID: notdfunc
Class template name was expected but not found. Example of code that generates the error message:
int foo () { return 0; } template<> int foo(); // ERROR: foo is not a template class name
Message ID: notempname
A parameter is required in templated classes to specify the object type for which the template will be generated. Example of code that generates the error message:
template<class T> class A { int i; T *data; public: A(int length=10) : data(new T[length]) {} }; int main() { A a; // ERROR: template requires a parameter return 0; }
Message ID: notempparm
A template class was declared as taking a few arguments, but none of them were provided at the point of instantiation. Example of code that generates the error message:
template <class A> class B {}; template class B<>; // ERROR: template arguments must be provided
Message ID: notemparg
Objects may not be called. Only a function may be called. Example of code that generates the error message:
void foo() {} int main() { int i; i(); // ERROR: only a function may be called foo(); // ok return 0; }
Message ID: notfunc
A tag or identifier is required in a declaration. Examples of code that generates the error message:
int; float; enum E;
Message ID: nothingdecl
According to the standard, operator new should have an exception specification. Example of code that generates the warning message:
#include <new> // Correct declaration: // void* operator new(size_t) throw(std::bad_alloc); void * operator new (size_t); // ERROR
Message ID: nothrownew
This operator previously had an exception specification. No exception will be thrown when this operator is called. Example of code that generates the warning message:
#include <stddef.h> void* operator new[] (size_t); // warning: original operator new throws "std::bad_alloc"
Message ID: nothrowneww
(Compatibility mode) Old-style new operator declaration does not use an exception specification. Example of code that generates the error message (in compatibility mode only):
#include <new.h> void* operator new(size_t) throw(std::bad_alloc); // ERROR: exception specification is // prohibited in compatibility mode // for operator new
Message ID: nothrowold
Case labels must be used only in switch statements. Example of code that generates the error message:
int main() { int i = 7; case 7: // ERROR: case statement is not in a switch statement i++; break; return 0; }
Message ID: notinsw
Default labels are used only in switch statements. Example of code that generates the error message:
int main() { int i; default: i = 3; return 0; }
Message ID: notinswdef
The pointer used to the right of \".*\" or \"->*\" is not a member pointer.
struct S { int i; }; void foo() { int y; S cs; int S::* pm = &S::i; // pm refers to member S::i cs.*pm = 88; // Ok cs.*y = 88; // ERROR: Not a member pointer // Right side of ".*" or "->*" must be a member pointer }
Message ID: notmembptr
The function resulting from .* or -> can only be called, it is impossible to obtain its address. Example of code that generates the error message:
class A { public: void foo () {} }; void (A::* f_ptr) (); int main () { A a; f_ptr = A::foo; a.*f_ptr; // ERROR: function can only be called. Valid code is // (a.*f_ptr)(); }
Message ID: notmembcall
This error usually occurs when user attempts to create a namespace alias for a non-namespace. Example of code that generates the error message:
struct not_a_namespace {}; int main () { namespace alias=not_a_namespace; // ERROR: attempt to create an alias for structure }
Message ID: notnamespace
The identifier has already been used, and cannot be redefined as a namespace. Example of code that generates the error message:
int n; namespace n { // ERROR int i; };
Message ID: notnsname
The compiler has found declared objects that were not used in the code and issued this warning. Example of code that generates the warning message:
void foo() { int i; // i not used } void foobar( int a, // a not used int b ) // b not used {}
Message ID: notused
The file typeinfo.h should be included to use the type_info class if this is intended. Otherwise, it is suggested that a differnet name be chosen if it is anticipated that the program in the future may use the typeinfo class for RTTI support.
Message ID: notypeinfoh
The using declaration expects a class name that is a base class. The name used was a namespace. Example of code that generates the error message:
namespace NS {int j; } //. . . class A: NS { using NS::j; };
Message ID: nsnotall
The using directive expects a namespace name. The name used was a name of a class type.
struct A{int j;}; void foo() { using A::j; // ERROR: namespace expected in a foo. }
Message ID: nsnotcl
The compiler has found a label that was never used, and issued this warning. Example of code that generates the warning message:
void foo() { int i = 0; goto b: a: --i; b: ++i; };
Message ID: labelnotused
A type name was expected but was not found. There are many cases that may cause this error. Examples of code that generates the error message:
class A: // ERROR: missing base class name {}; struct B { int i; j; // ERROR: Type name expected instead of "j" }; struct D : B, { // ERROR: another base class name expected after the "," int j; D() : { j = 10; }; // ERROR: type name expected instead of "{", missing initializer }; template <class T, class K> class A {}; A<int, > a; // ERROR: missing type name after comma
Message ID: notypenameerr
Predefined macros are used by the compiler and cannot be defined or undefined.
Message ID: noundef
Unions may not have a base type. Example of code that generates the error message:
class C { int i; }; union B: C { // ERROR int j; };
Message ID: nounionbase
Unions may not have a base type. Example of code that generates the error message:
union C { int i; }; union B: C { // ERROR int j; };
Message ID: nounionasbase
Unions cannot have virtual functions. Example of code that generates the error message:
union A { int i; void foo() {}; // ok virtual void foobar() {}; // ERROR };
Message ID: nounionvirt
The type data void is a non-value. Example of code that generates the error message:
foo() { int i = (void)1; }
Message ID: novoidval
void pointers may not be dereferenced. A void has no value. Example of code that generates the message:
void *i; int j = *i; // ERROR: cannot dereference a void*
Message ID: novoidderef
A do block must be ended with a while statement in a do-while loop. Example of code that generates the error message:
void foo() { int i = 0; int j = 7; do { i++; } // ERROR: "while" expected instead of "}" i = 0; do { i++; } while ( i < j); // ok }
Message ID: nowhileerr
Using directives may not be used in a class. Example of code that generates the error message:
namespace NS { int j; }; class A { using namespace NS; };
Message ID: nsdirinclass
Reference initializtion expression is evaluated to zero. Example of code that generates the error message:
static int zero; int& c = *(int*)0; // Warning: reference initialized to zero
Message ID: nullref
Base initialization without a class name or member name is now obsolete. Example of code that generates the error message:
struct A { int i; A(int); }; struct B: A { int j; B() : (3) { // ERROR j = 7; }; };
Message ID: obsinit
A function definition cannot declare other objects. Only class definitions may declare other objects. The declaration of a function along with an object will not trigger this error unless the function is trailed by another object declaration. Example of code that generates the error message:
int i, foo() { // ERROR: cannot declare an function here. return 0; } int j;
Message ID: onlyonefunc
An expression has overflowed the size of an int, or a number was divided by zero.
Message ID: overflow
The compiler has run out of memory. Free some resources and try again.
Message ID: outofmem
Initializing struct members without brackets will generate warnings when compiled with the "+w2" flag. Example of code that generates the error message:
struct B { int i; int j; } X[] = { 1, 2, 3, 4 };
Message ID: partinit
An #else directive must have a prior corresponding #if directive. Example of code that generates the error message:
//#if true #define num 1 #else num 0 // . . .
Message ID: ppbadelse
The preprocessor directive #endif must have a corresponding #if.
Message ID: ppbadendif
There is extra text after the preprocessor command. Example of code that generates the error message:
#include <file.h>; // ERROR: remove the extra ";"
Message ID: ppextra
The extra text on this line is ignored in ANSI C.
Message ID: ppextraw
Only the prefix increment or decrement operator was declared. The postfix operator must also be declared before use. Example of code that generates the error message:
class A { public: int i; A operator ++(); // prefix operator++ declared }; int main() { A a; a++; // ERROR: overload the postfix operator ++ to correct }
Message ID: postincdec
Structure and enum types should be declared prior to use in the function prototype. This message appears when the compiler is set to compile in C mode.
Message ID: protodec
An abstract class of one or more pure virtual functions can only be used as a base class. You cannot directly create an instance of an abstract class. You must create objects of derived classes. Example of code that generates the error message:
class A { virtual void foo() = 0; virtual int bar() = 0; }; A a; // ERROR
Message ID: purealloc
An abstract type cannot be used as a member. If this member is a derived class, make sure this class has defined all the pure virtual functions in the base class. Example of code that generates the error message:
class B { virtual void foo() = 0; }; class X { B b; }; // ERROR: B is abstract template <class T> class Y {}; Y<B> y; // ERROR
Message ID: puremem
A parameter cannot be an abstract type.
Message ID: pureparm
The return type specification cannot be an abstract class. An abstract class has not been implemented, and cannot be used. If the return specification is a derived class, make sure this class has defined all the virtual pure functions in the base class. Example of code that generates the error message:
class B { virtual B foo(B) = 0; // ERROR: foo(B) returns an abstract type }; class A: B {}; A bar() { // ERROR A *a; return *a; }
Message ID: purert
A value cannot be created from an abstract class. Example of code that generates the error message:
class A { public: virtual int foo () = 0; }; class B : public A { public: virtual int foo () { return 0; }; }; int main () { B * b = new B(); A& a = (A) *b; // ERROR: A is the abstract class }
Message ID: pureval
The variable of the derived class of an abstract class has been instantiated before the pure virtual function of the base class has been overridden. Example of code that generates the error message:
class B { virtual void foo() = 0; }; class A: B {}; A a; // ERROR
Message ID: puref
A member function cannot be declared with a type qualifier to specify a different scope.
class A { }; class B { void A::foo(); // ERROR: cannot use type qualifier void B::goo(); // ok. goo() is declared in class B };
Message ID: qualnotok
Only the storage class register is allowed in a parameter list. static, extern, and mutable are not allowed. Example of code that generates the error message:
class A { void foo( register int a,// ok mutable int b, // ERROR extern c, // ERROR static int d, // ERROR auto int e ) // ok {} };
Message ID: registeronly
An anonymous union member cannot have the same name as its containing class. Example of code that generates the error message:
class A { union { int i; long j; int A; // ERROR }; };
Message ID: sameanon
An enumerator cannot have the same name as its containing class. Example of code that generates the error message:
class A { enum e { A, B, C }; // ERROR };
Message ID: sameenum
A static member may not have the same name as its containing class Example of code that generates the error message:
class A { static int A; };
Message ID: samestatic
You cannot define a type within a class of the same name. Example of code that generates the error message:
class A { typedef struct { int a; } A; // ERROR: class A and typedef A have the same name };
Message ID: sametype
The expression must be a scalar type. Example of code that generates the error message:
class A { public: A() { i = 0; } int i; A foo() { return *this; } }; void foo() { A a; if( a ){ // ERROR: scalar type expected, not type A } for( a.i; a; // ERROR a.i++) {} }
Message ID: scalarexpected
sizeof may not be applied to a bit field. Example of code that generates the error message:
class A { public: A() { size = sizeof(i); } int i:3; int size; };
Message ID: sizeofbf
sizeof cannot be applied to a function. It may only be applied to primative types, class objects, and expressions. Example of code that generates the error message:
int i; int j; int foo(int k); int goo(); k = sizeof (i*j*foo(10)); //ok k = sizeof (unsigned int); //ok k = sizeof(foo); // ERROR k = sizeof(goo); // ERROR
Message ID: sizeoffunc
An overloaded funciton cannot have both static and notstatic versions. Example of code that generates the error message:
class A { static void foo(); void foo(); // ERROR };
Message ID: statnonconf
Syntax error. The specifier is not allowed here. Examples of code that generate the error message:
inline class A{}; // ERROR virtual void foo(); // ERROR void foo() { virtual void f1(); // ERROR friend void f2(); // ERROR explicit void f3(); // ERROR }; void foo() {}
Message ID: storenotok
The specifier used is not allowed here, and is ignored by the compiler. This message can also be issued if there was an attempt to typedef a template. Example of code that generates the warning message:
template <class T> static class A; // Warning: "static" is not allowed and is ignored
Message ID: storenotokw
The compiler has determined that the subtraction of the floating point numbers overflow, and it is deferred to runtime to be handled.
Message ID: subfovfl
A local variable is bypassed and cannot be initialized. Example of code that generates the error message:
void foo() { int i=7; switch(i) { case 7: break; int j = 2; default: // This case bypasses the initialization of the local variable j i = 8; } }
Message ID: swuninit
An invalid type or no argument was supplied for this template argument. Example of code that generates the error message:
template <class T, class K> class B { public: T t; K k; }; B<int> b1; // ERROR: B<T,K> requires another template argument B<int, 12345> b2; // ERROR: 12345 is not valid
Message ID: temargnotype
The expression does not match the type of the template parameter. MORE//No conversions are applied for a non-type template-parameter of type reference to object. Example of code that generates the error message:
template <int i> class A {int i;}; ; A<3.141593> a1; // ERROR: argument not an int A<3> a2; // ok template<class T, char* p> class D { D(); D(const char* q); }; D<int,"penny"> x1; // error: string literal as template-argument char p[] = "dime"; D<int,p> x2; // OK
Message ID: temargnoval
Actual parameters of the wrong type were passed as template parameters. Usually this means that NULL pointer was passed as a template parameter of pointer type - this will cause an error since NULL pointer conversion cannot be applied to template parameters. Example of code that generates the error message:
template <char * i> class A {}; int main () { A<0> a; }
Message ID: tempargnullptr
Default template parameters are allowed for class templates and class member functions only. Example of code that generates the error message:
template <class T=int> T foo();
Message ID: temdefparms
Non-type template parameters are not allowed for non-member functions. Example of code that generates the error message:
template <int x> int foo();
Message ID: temfuncnontype
The template has too many arguments.
Message ID: temmanyargs
Templates are used for classes and functions only. Example of code that generates the error message:
template <class T> int i;
Message ID: tempnotfunc
Templates can only be declared at the global level. Example of code that generates the error message:
void foo() { int i; template <class T> class B { int j; }; // ERROR };
Message ID: temnotglob
Templates may be nested 20 levels deep only.
Message ID: temtoodeep
The member cannot be qualified.
Message ID: tdefqual
The exception specification includes two of the same object types. Example of code that generates the warning message:
void foo() throw(float i, float j);
Message ID: tltwice
The exception specification has been changed from the declaration. Exception specifications must match. Example of code that generates the error message:
void foo() throw(int i); // . . . void foo() throw(float i) {} // ERROR
Message ID: tnotinnew
The previous exception specification did not contain the current argument type. Exception specifications must match. Example of code that generates the error message:
void foo() throw(); // . . . void foo() throw(float i ) {} // ERROR
Message ID: tnotinold
The call to the function has fewer arguments than the function declaration. Example of code that generates the error massage:
void foo( int i, int j ) {} int main() { foo(1); // ERROR: not enough arguments in call to foo() return 0; }
Message ID: toofewargs
The call to the macro has fewer arguments than in the macro definition. Example of code that generates the warning message:
#define mask 0xffff00 #define getField(data, mask) data & mask // macro defined to take 2 arguments int field = getField( 1 ); // ERROR: call to macro has 1 argument
Message ID: toofewmargs
Template has more arguments than were provided. Example of code that generates the error massage:
template <class A1, class A2> class B {}; int main () { B<int> b; }
Message ID: toofewtargs
The call to the funciton has more arguments than the function declaration. Example of code that generates the warning message:
void foo( int i, int j ) {} int main() { foo( 1, 2, 3 ) return 0; }
Message ID: toomanyargs
Syntax error encountered, too many arguments have been passed to cast expression. Example of code that generates the error message:
class A { public: operator long (); }; int main () { long t = long(A(), 0); // ERROR: too many arguments in cast to long // Should be: // long t = long(A()); }
Message ID: toomanycargs
The call to the macro has more arguments than are defined by the macro. Example of code that generates the error message:
#define mask 0xff0000 #define getField(data,mask) data & mask // macro defined with 2 arguments int field = getField( 1, 2, mask ); // call to macro has 3 arguments
Message ID: toomanymargs
Constructor initializers take only one parameter. Example of code that generates the error message:
class A { int i; A(): i(1,2) {} };
Message ID: toomanynargs
There were too many arguments for the template. Example of code that generates the error message:
template< class T, class K > // 2 template parameters class A { T t; K k; }; A<int, float, long> a; // ERROR: 3 template arugments
Message ID: toomanytargs
Access level of a class member cannot be changed to private. Access can only be changed to public or protected. Example of code that generates the error:
class A { public: int i; }; class B: A { private: A::i; };
Message ID: topubliconly
A value has been initialized twice. Example of code that generates the error message:
class A { public: static const int j = 9; A() {} }; const int A::j = 9; // A::j initialized twice
Message ID: twoinits
The expression is too complex. Example of code that generates the error message:
void foo(){ int **************************i; **************************i = 9; // ERROR: too complex, 26 "*" }
Message ID: twtoocomp
The type name has not been defined prior to the use of the function or class. Example of code that generates the error message:
template<class T> class A { T t; }; class B{ int i; }; int main() { A<float> a; // ok B<int> b; // ERROR: template not defined for type B }
Message ID: typenotall
A variable that has not yet been assigned a value has been used. Example of code that generates the warning message:
void foo() { int i; i++; }
Message ID: unassigned
An identifier has been used but has not yet been defined. Example of code that generates the error message:
void foo() { int i; j++; // ERROR: j is not defined }
Message ID: undefidenterr
Template must be defined before using it as template type parameter Example of code that generates the error message:
template <t_arg<int> > struct tmp {}; // ERROR: t_arg is not defined
Message ID: undeftemperr
The result of a comparison is unused. Example of code that generates the warning message:
void foo() { int i = 9; i == 9; // Warning: result unused i++; }
Message ID: unusedcomp
Virtual constructors are not allowed. Example of code that generates the error message:
class A { int a; virtual A(); // ERROR };
Message ID: virtconstr
A qualifying class name is required for virtual friend functions. Example of code that generates the error message:
void foo() { return; } void goo() { return; } class A { virtual friend void foo(); // ERROR virtual friend void A::goo(); // ok };
Message ID: virtfriend
A function is expected to return a value but is returning void. Example of code that generates the error message:
int foo() { return; // ERROR: Return of type int expected }
Message ID: voidret
The address-of operator can be applied to a variable or lvalue only. There must be an address to take. Example of code that generates the error message:
int *i = &3; // ERROR: "3" is not an lvalue
Message ID: wantvarname
Only signed or unsigned int bit fields are supported in ANSI C.
Message ID: wbadbftype
Operator new or operator delete should have a different linkage. Example of code that generates the warning message:
#include <new> // WARNING: new should not be static (it was declared as extern). static void* operator new(size_t) throw(std::bad_alloc);
Message ID: wbadlinkage
The declaration is empty. The most likely cause is an extra semicolon. Example of code that generates the error message:
; // Warning: no declaration namespace NS{}; // Warning: Namespace NS has extra semicolon at end }; // ERROR: the right parenthesis is unmatched
Message ID: wemptydecl
(Kernigan and Ritchie): A tag or identifier is required in a declaration. Examples of code that generate the error message:
struct {}; // ERROR
Message ID: wnothingdecl
There was an assignment of a type to an incompatible type. A constuctor, conversion function, or overloaded assignment operator may be required for class object types. Example of code that generates the warning message:
class B { int i; }; class A: B { int j; }; void foo() { A a; B b; a = b; // ERROR b = (B)a; // ERROR: no constructor or no conversion function in A for type B A *pa = &a; B *pb; pb = (B*)pa; // ok, pa* is cast to a pointer to a base class }
Message ID: wbadasg
The string literal was converted to a char* on assignment. Example of code that generates the warning message:
void foo () { char *s; s = "abcd"; // Warning }
Message ID: wbadasgl
Initializing a type with different type is a warning.
Message ID: wbadinit
A string literal has been used to initialize a different compatible type.
void foo() { char * s = "f"; // warning: using const char* to initialize an E }
Message ID: wbadinitl
(Kernigan and Ritchie): The function is declared to return a value but does not. Example of code that generates the error message:
int foo() { return; // ERROR: foo() expected to return a value }
Message ID: wvoidret
The variable in the function hides a class member name. Example of code that generates the warning message:
class A { int i; void foo() { int i; // Warning: i hides A::i } };
Message ID: wvarhidemem
The variable hides a variable name in outer scope. Example of code that generates the warning message:
void foo() { int i; for ( int i = 0; // Warning: i hides variable in outer scope. i < 10; ++i ){}; }
Message ID: wvarhidenmem
You can pass only a void function with no arguments as a parameter to init or fini pragmas. Example of code that generates the error message:
void my_fini (int a) { } #pragma fini(my_fini)
Message ID: prbadfunc
Some pragmas require at least one parameter to be passed. Example of code that generates the error message:
#pragma fini ()
Message ID: premptylist
The alignment value must be a non-negative integral power of 2, but must be at most 128. Example of code that generates the error message:
#pragma align 256 ( an_int, a_ptr, a_struct, a_class )
Message ID: prbadalign
Some pragmas require their arguments to be functions. Example of code that generates the error message:
int my_fini; #pragma fini(my_fini) // ERROR: my_fini is not a function
Message ID: prnotfunc
You should declare a function first if it appears in any pragma parameter list. Example of code that generates the error message:
#pragma fini(my_fini) // ERROR: my_fini should be declared first void my_fini (int a) { }
Message ID: prnotdecl
Pragma statement is incorrect. Most likely, an obligatory pragma argument omitted. Example of code that generates the error message:
int a, b, c; #pragma align (a, b, c)
Message ID: prsyntax
A string literal was missing after #pragma ident.
Message ID: prnostr
Wrong symbol was used as pragma argument's separator. Example of code that generates the error message:
void my_init1 () { } void my_init2 () { } void my_init3 () { } #pragma init(my_init1,my_init2.my_init3)
Message ID: prnocomma
Pragma parameter list should begin with '('. Example of code that generates the error message:
void my_init1 () { } #pragma init my_init1)
Message ID: prnolp
Missing ')' or wrong symbol in parameter list encountered. Example of code that generates the error message:
void my_init1 () { } void my_init2 () { } void my_init3 () { } #pragma init(my_init1,my_init2.my_init3)
Message ID: prnorp
This message is used by the compiler to display line numbers with error messages.
Message ID: linetheword
There must be a string literal in asm statements. Example of code that generates the error message:
void foo() { asm( nop ); // ERROR }
Message ID: noasmstring
An asm statement is not allowed outside a function. Example of code that generates the error message:
asm(" nop "); // ERROR void foo() { asm(" nop "); // ok }
Message ID: asmnotinfunc
Value was expected for the specified flag.
Message ID: cmd_needvalue
Some CC flags cannot be specified simultaneously (for example, +e0 and -compat=5).
Message ID: cmd_badflag
This error is issued by ccfe when no input file is passed.
Message ID: noinpfile
The file passed to the compiler is missing or inaccessible and could not be opened.
Message ID: openinpfile
Preprocessor cannot open output file. Please check file permissions and/or free disk space.
Message ID: openoutfile
This warning indicates that the file does not end with a newline character.
Message ID: nonewline
The keyword mutable cannot be used outside a class. The mutable is used to enable modification of a field in a class object declared const. Example of code that generates the error message:
void foo() { mutable int i = 0; // ERROR } class A { mutable int i; // ok };
Message ID: mutclassonly
mutable can only be used for member data. Example of code that generates the error message:
class A { public: mutable int i; //ok mutable void foo() {} // ERROR A() {} };
Message ID: mutnofunc
const names cannot also be declared mutable. Example of code that generates the error message:
class A { public: A(int j) { i = j; }; mutable const int i; // ERROR };
Message ID: mutnoconst
A static data member cannot be made mutable. Example of code that generates the error message:
class A { public: mutable static int i; };
Message ID: mutdatamems
Overloaded operators must be declared with language C++
class A {}; extern "C" A& operator *(A&, A&);
Message ID: mustbecpp
A class definition cannot be specified in a friend declaration. Example of code that generates the error message:
class A { friend class B {}; // ERROR: class definition in a friend declaration };
Message ID: nofrienddef
The specification of the access level of class members was not followed by a colon. Private, protected, and public must be followed by a colon here. Example of code that generates the error message:
class A { public // ERROR:public not followed by ":" int i; };
Message ID: nocolaftacc
The end of file was found before the end of the macro arguments.
#define foo( A, B, C ) foo(1, 2, // ERROR: missing argument. <EOF>
Message ID: eofinmargs
Variables declared with an implicit int are not supported in C++. The type should be specified. Example of code that generates the warning message:
i[] = {1, 2, 3};
Message ID: noimplint
A class key was expected in the template declaration. This error can also be caused by an incorrect function template declaration that appears to be a class template declaration. Example of code that generates the error message:
template <class T> A // ERROR: class key is missing { int i; int j; }; template <class T> foo : /* . . . */ ; // ERROR
Message ID: noclasskey
Locally defined types cannot be used as template arguments. Example of code that generates the error message:
template <class T> class A{}; void foo() { class B {}; enum E {one, two, three}; A<B> a1; // ERROR A<E> a2; // ERROR }
Message ID: nolocaltarg
A template argument cannot be an unnamed type. A type also cannot be defined in the template argument at the same time. Example of code that generates the error message:
template <class T> class A { T t; }; A<class{}> a; // ERROR: The struct has no type name. // To use a user defined type, define the type before use.
Message ID: nounnamedtarg
A syntax error has been detected while parsing a constructor initializer list. Example of code that generates the error message:
class A { int a; long b; int c[2]; A() : a(0) : b(0) {} // ERROR: unexpected ':' in initializer list };
Message ID: unexpinitl
This is an internal message used by the Java Native Compiler
Message ID: jdeadcode
This is an internal message used by the Java Native Compiler
Message ID: jnoclass
This is an internal message used by the Java Native Compiler
Message ID: jnomember
This is an internal message used by the Java Native Compiler
Message ID: jbadcpool
This is an internal message used by the Java Native Compiler
Message ID: jbadtcode
This is an internal message used by the Java Native Compiler
Message ID: jbadbcode
export has been ignored. It has not yet been implemented.
Message ID: exportnotimpl
The keyword template was not found before "<" in the template declaration. Example of code that generates the error message:
export <class T> // ERROR class A{};
Message ID: notemplkey
The old explicit specialization syntax has been found and this warning is issued. The new explicit specialization syntax is as follows: template-id: template-name < template-argument-listopt > template-name: identifier template-argument-list: template-argument template-argument-list , template-argument template-argument: assignment-expression type-id id-expression
Message ID: oldexpspecial
Explicit non-class, non-function instantiation/specialization has not yet been implemented in this compiler.
Message ID: noexpimpl
The class has overloaded the "->" operator. The operator returns a value of class type. Example of code that generates the error message:
class A { public: int j; A operator->(); // returns an A }; void foo() { A a; a->j = 9; // ERROR };
Message ID: recurarrow
The overloaded operator-> should return a pointer to an object of class type. Example of code that generates the error message:
class B { public: int j; B operator->(); // returns an B B& operator->(); }; void foo() { B b; b->j = 7; // ERROR: ambiguity, operator->() returns B };
Message ID: recurarrow2
The overloaded "->" operator should return a pointer to an object of class type. Example of code that generates the warning message:
class A { public: int* operator->(); // Warning A::operator->() returns int* int k; };
Message ID: arrowrtn
Casting between function pointers and object pointers has undefined results, but on Solaris does not lose information.
Message ID: badcastw
An anonymous union in class may not have some specifiers such as extern, static, and the like. Example of code that generates the error message:
class A { static union { // ERROR: anonymous union may not be static int a; long b; }; };
Message ID: badclanon
Namespace declaration within a class is not allowed Example of code that generates the error message:
class A { namespace ns {} // ERROR: namespace declaration in a class scope };
Message ID: noclassns
Template parameter may not be redeclared in this scope. Most likely, a template parameter's name was used in a declaration within a template scope. Example of code that generates the error message:
template <class t_arg> class A { int t_arg; // ERROR: template parameter t_arg redeclared }; int main () { A<int> a; }
Message ID: templparamdecl
Using a template parameter in an elaborated type specifier is prohibited. Example of code that generates the error message:
template <class t_arg> class A { class t_arg {}; // ERROR: template parameter t_arg used in elaborated type specifier }; int main () { A<int> a; }
Message ID: templtypedecl
Syntax error encountered. Example of code that generates the error message:
template <class t_arg> class A {}; typedef class A<int> my_type; // ERROR: Illegal syntax ...
Message ID: badelabtype
The valid values for pragma pack must be a power of two. Example of code that generates the error message:
#pragma pack (3)
Message ID: prbadpack
It is impossible to declare a template with extern C linkage. Example of code that generates the error message:
extern "C" template <class t_arg> class A {}; // ERROR: template declaration cannot have this linkage
Message ID: temnotexternc
A typename keyword is required when type names are qualified by template parameters Example of code that generates the error message:
class A { public: typedef int my_type; }; template <class t_arg> class B { public: typedef t_arg::my_type my_type; // WARNING }; int main () { B<A>::my_type c; }
Message ID: typenameass
The cast is ambiguous. Example of code that generates the error message:
class A {}; class B : public A {}; class C : public A {}; class D : public B, public C {}; int main () { D *d = new D; A *a = (A*) d; // ERROR: D contains two A instances }
Message ID: ambigcast
Template cannot be declared as friend without specialization. Example of code that generates the error message:
template <class t_arg> class A {}; class B { friend class A; // ERROR: friend template declaration. Should be: // friend class A<int>; };
Message ID: nofriendtmpl
Template function cannot be declared as friend. Example of code that generates the error message:
template<class t_arg> int foo () { return t_arg; } class A { friend int foo<int>(); // ERROR: template function cannot be friend };
Message ID: nofunctmpl
A function declared to be a friend has not been found in global scope. Example of code that generates the error message:
class A { friend int ::foo (); // ERROR: foo is not declared in global scope };
Message ID: noglobaldecl
Some CC flags cannot be specified simultaneously (for example, +e0 and -compat=5).
Message ID: cmd_badflag_wrn
Some CC flags cannot be specified simultaneously (for example, -memtmpl and -compat=5).
Message ID: cmd_badflag_err
A reference to the bit field is non-constant Example of code that generates the error message:
struct C { int x : 2 ; }; C oc; int & xref = oc.x; // ERROR: xref is a non-constant reference
Message ID: varbitref
Cannot open a file specified by the option -preinstlib=<file-name>.
Message ID: openinstlib
Cannot read symbols from a file specified by the option -preinstlib=<file-name>.
Message ID: readinstlib
An attempt was made to declare a member fuction using a function type template parameter. Example of code that generates the error message:
template <class T> struct X { T t; }; typedef int F(); X < F > m1; // ERROR: cannot delcare 't' as a int t().
Message ID: badtmplfunctyp
A template-argument for a non-type, non-template template-parameter cannot have given type. See ISO C++ Standard 14.3.2 for details. Example of code that generates the error message:
template<class T, int I> class X { }; X<int, 2.7> x;
Message ID: badtmplexparg
A string literal (lex.string) is not an acceptable template-argument because a string literal is an object with internal linkage. See ISO C++ Standard 14.3.2 for details. Example of code that generates the error message:
template<class T, char* p> class X { }; X<int,"String"> x;
Message ID: tmplexpstrlit
Addresses of array elements and names or addresses of non-static class members are not acceptable template-arguments. See ISO C++ Standard 14.3.2 for details. Example of code that generates the error message:
template<int* p> class X { }; int a[10]; X<&a[2]> x;
Message ID: tmplexpaddarr
User specifies actual template argument list that matches more than one partial specialization. Example of code that generates the error message:
template<class T1, class T2, int I> class A { }; template<class T1, class T2, int I> class A<T1*, T2, I> { }; // #1 template<class T1, class T2, int I> class A<T1, T2*, I> { }; // #2 A<int*, int*, 2> a5; // ambiguous: matches #1 and #2
Message ID: ambigpartial
There is no primary specialization before partial specialization. The user should always supply primary specialization in order to declare or define partial specialization. Example of code that generates the error message:
template<class T> class A<T, T*> { }; template<class T1, class T2> class A { };
Message ID: psnoprimary
The template parameter list of a specialization shall not contain default template argument values. Since there is no way in which they could be used. Example of code that generates the error message:
template<class T1, class T2> class A { }; template<class T = int> class A<T, T*> { };
Message ID: psdefaults
Nontype parameter may not be used as part of an expression. Example of code that generates the error message:
template<class T, int p, int c> class X { }; template<class T, int p > class X<T, p, p + 5> { };
Message ID: psntinexpr
The partial specialization should not has arguments identical to the primary specialization, since there is no use of such a construct. Example of code that generates the error message:
template<class T1, class T2> class A { }; template<class T1, class T2 > class A<T1, T2> { };
Message ID: pssameargs
The type of a template parameter corresponding to a specialized non-type argument shall not be dependent on a parameter of the specialization. Example of code that generates the error message:
template< int X, int (*array_ptr)[X] > class A {}; int array[5]; template< int X > class A<X,&array> {};
Message ID: psargdeptype
User supplies one or more partial specialization parameters and do not use them in the specialization itself. Example of code that generates the error message:
template<class T1, class T2> class A { }; template<class T, class T2> class A<T, T*> { };
Message ID: psargnotused
This message is issued when user explicitly switch the partial specialization handling off. Example of code that generates the error message (in compatibility mode only):
template<class T1, class T2> class A { }; template<class T> class A<T, T*> { };
Message ID: psnotimp
Example of code that generates the error message:
class B { public: B() : i(0) { } ~B() { } int i; }; class D : public B { public: using B::~B; // error - using cannot refer to destructor D() : j(0) { } int j; }; int main() { return 0; }
Message ID: usingdestr
Compiler encountered a SunWS_cache directory that is incompatible
with this compiler. This error is produced when an older
compiler encounters a template database produced by a newer compiler.
Use the newer compiler to compile the sources, or use
CCadmin -d
Message ID: tdb_version
More than one -I- option was found on the command line.
Message ID: duplicate_i
Example of code that generates the error message is:
template < class T > void copy ( T to ) { } template int copy ( long ) ; // Error!
Message ID: badexplctinst
Example of code that generates the error message is:
struct x { x(); int x; };
Message ID: samemem
The sizeof operator shall not be applied to an enumeration type before all its enumerators have been declared. Example of code that generates the error message is:
int mymain() { enum E { A, B = sizeof A }; // error - can't apply sizeof A yet return 0; }
Message ID: badenumsize
In C++, it is incorrect to assign a pointer to complete array type to a pointer to incomplete array type, and vice versa. Example of code that generates the error message is:
extern int a_39W73zz[2]; // size is known int (*p2)[] = &a_39W73zz; // error - mismatched type, size is unknown for `p2`.
Message ID: badarrptr
Compiler cannot handle situation when return type of the virtual function is a struct type with no definition and rejects the code. Example of code that generates the error message is:
struct Fum; // incomplete type struct B { Fum virtual f(); }; struct D : virtual B { D(); }; D::D() { }
Message ID: incompletert
Access to a member cannot be changed this way. This is a warning in compatibility mode but an error in standard mode. Example of code that generates the error message:
class C { private: class inner; public: class inner { }; // redeclaration with different access };
Message ID: badaccadjw
The called overloaded function is ambiguous. Example of code that generates the error message:
void foo (int i, int j); void foo (int i = 3, int j = 7);// ok: redeclaration of foo(int, int) void foo (); // ok: overloaded declaration of foo int main() { foo (1, 2); // ok: call f(int, int) foo (); // ERROR: call f(int,int) or f()? }Ambiguity may also arise from use of constructors and conversion operators:
struct A { A(int); }; struct B { B(int); operator int(); operator double(); } b; A foo( A a ); B foo( B b ); int main() { foo(1); // ERROR: foo(A) or foo(b)? } int i = b; // ok: conversion of B to int matches float f1 = b; // ERROR: call int or double operator? float f2 = double(b); // ok: conversion operator specified.
Message ID: manymatchover_w
An attempt was made to directly access private members in a class. Example of code that generates the error message:
class A { int i; // private data member }; void foo() { A a; a.i = 9; // ERROR: Error: i is not accessible from foo() } class T { T(const T&); // private copy constructor }; void foo( T t ) {} // ERROR: cannot pass a T, copy constructor is private T f2() { T t; return t; } // ERROR: cannot return a T
Message ID: inaccessible_w
Extra semicolon detected at the end of a field declaration Example of code that generates the warning message:
struct S { int ii;; void f();; };
Message ID: fieldsemicolonw
Cannot take address of a compiler generated temporary. Example of code that generates the warning message:
struct C { C(int); }; void add( C *c ); void foo() { add( &C(6) ); }
Message ID: addressoftemp
Example of code that generates the warning message:
struct A { friend static void foo(A arg); };
Message ID: storeclassfriend
Example of code that generates the warning message:
class C { C::C(); enum E { a, b } e; }; C::C() { switch(e) { case E::a: // <-- fails here break; } }
Message ID: enumasscope
The statement is never reached. Example of code that generates the error message:
int foo(int x) { if ( x > 0 ) return 1; else return 2; return 3; // Warning: statement is unreachable }
Message ID: wunreachable
The last statement of a non-void function should return a value. Example of code that generates the error message:
int foo(int x) { if ( x > 0 ) bar(); // Warning: The last statement should return a value else return 2; }
Message ID: wnoretvalue
The else-branch of an if statement should return a value. Example of code that generates the error message:
int foo(int x) { if ( x > 0 ) // Warning: The else-branch should return a value return 2; }
Message ID: wnoelseretvalue
An anonymous struct in class may not have some specifiers such as extern, static, and the like. Example of code that generates the error message:
class A { static struct { // ERROR: anonymous struct may not be static int a; long b; }; };
Message ID: badclanonstruct
An anonymous struct member cannot have the same name as its containing class. Example of code that generates the error message:
class A { struct { int i; long j; int A; // ERROR }; };
Message ID: sameanonstruct
Anonymous structs cannot have private or protected members. Example of code that generates the error message:
static struct { long j; private: int i; // ERROR };
Message ID: anonstructnoprivate
Anonymous structs cannot have function members. Example of code that generates the error message:
static struct { void foo(){} // ERROR };
Message ID: anonstructnofunc
Example of code that generates the warning message:
union U { struct { int a; long b; }; };
Message ID: anonstruct
Example of code that generates the warning message:
enum A;
Message ID: forwardenum
If a function declaration in namespace scope or block scope has the same name and the same parameter types as a function introduced by a using directive, the program is ill-formed. Example of code that generates the error message:
namespace B { void f(int); } namespace N { using B::f; // introduces B::f(int) into N void f(int); // error: N::f(int) conflicts with B::f(int) }
Message ID: ambigdecl
If a union contains a member of reference type, the program is ill-formed. Example of code that generates the error message:
union x { int &i; };
Message ID: nounionref
Example of code that generates the warning message:
unsigned long l; void foo() { l >> 32; // should get a warning }
Message ID: largeshift
Cannot take address of a compiler generated temporary.
Message ID: compataddressoftemp
Example of code that generates the warning message:
enum E { e1 = 5 }; struct S { E e; } s = { 5 }; // warning
Message ID: wintenuminit
Function can throw only the exceptions allowed by the function it overrides Example of code that generates the error message:
struct A { virtual void foo() throw(A); }; struct B : A { virtual void foo(); };
Message ID: lessrestrictedthrow
No ordinary operator delete was found in scope. Most likely, operator delete was illegally overriden in class scope. Example of code that generates the error message:
#include <new> template<class t_arg> class A { public: void operator delete(void*, const std::nothrow_t&) throw(); }; int main () { A<int> * a = new A<int>; }
Message ID: whideferr
Example of code that generates the error message:
class A { public: int a; void foo () const { a++; } }
Message ID: constaccess
Most likely the keyword 'class' is missing from the explicit instantiation declaration. Example of code that generates the error message:
templateclass X { }; template X ; // should be: template class X ;
Message ID: explclassinst
Should not initialize a non-const reference with a temporary Example of code that generates the warning message:
struct C { C(int); }; void add( C& c ); void foo() { add( C(6) ); }
Message ID: reftotemp
Template expression cannot be a non-const value. Example of code that generates the error message:
templatevoid f(); int main() { const int& ri = 12; f (); // error }
Message ID: tmplexpnotconst
Function can throw only the exceptions allowed by the function it overrides Example of code that generates warning:
struct A { virtual void foo() throw(A); }; struct B : A { virtual void foo(); };
Message ID: wlessrestrictedthrow
Returning a pointer to a local automatic variable. Example of code that generates this warning message:
int* f() { int k=5; return &k; }
Message ID: autoaddrreturn
ptr to array of unknown size param Example of code that generates the error message:
typedef int UNKA[]; void f(UNKA *p);
Message ID: ptrarray0
reference of array of unknown size param Example of code that generates the error message:
typedef int UNKA[]; void f(UNKA &p);
Message ID: refarray0
Actual argument depends on template parameter(s) Example of code that generates the error message:
void foo(...); templateT count(T t); void bar() { foo(count); }
Message ID: dummyactualarg
An identifier was expected. This can be used in situations where the construct is in error, but the compiler can effectively recover. Example of code that generates the error message:
enum A {a, };
Message ID: identexpected
No two function defintion can have the same extern name Example of code that generates the error message:
#pragma redefine_extname fstat64 fstat extern "C" { int fstat(int fstat_int) { return (fstat_int+2); } int fstat64(long fstat64_long) { if (fstat64_long == 0) return 0; return -1; } } // error, fstat64 has the same extern name as fstat
Message ID: sameextname
When compiling for whole program optimization (-xcrossfile or -xipo) in compatibility mode, static variables nested within inner scopes are not allowed.
For example in
int f(int i) { if (i != 0) { static int sv = 2; return sv + i; } return 0; }sv will trigger this error.
Message ID: nocrossstatic
static data member definition uses the derived class Example of code that generates the warning:
struct BASE { static int static_data; }; struct DERIVED : public BASE { }; int DERIVED::static_data;
Message ID: staticmemsearch
A field declaration cannot be parsed in the representative instantiation of a template class prehaps due to name lookup problems. This template class is rendered invalid.
For example:
template < class T > struct base { typedef T b_type ; } ; template < class T > struct derived : public base < T* > { typedef base < T* > Base ; const b_type foo ( const T & t ) const { } } ;The member function foo cannot be parsed because b_type cannot be looked up as a type when parsing the representative instantiation for class derived.
Message ID: skipfield
No exception specification allowed in a typedef declaration
For example:
typedef void (*pf) () throw();
Message ID: badexceptionspec
Function pointer can only throw the exceptions thrown by the function pointer it is assigned to Example of code that generates warning:
void (*pf1)(); void (*pf2)() throw(int); void f() { pf2 = pf1; }
Message ID: fptrthrow
Example of code that generates the message: int NE_C2_3() { int a = 1;
#pragma omp parallel if ( a > 1 ) if ( a < 5 ) { } return 0; }
Message ID: omp_extraclause
OpenMP parallel and worksharing constructs are require to be followed by structured block. A structured block is a statement that has a single entry and a single exit. No statement that causes a jump into or out of the block is allowed. A structured block cannot contain a return, goto, break or continue statement that causes control to flow out of the block. Example of code that generates the message:
int NE_C2_4_1_1() { int i; #pragma omp for for (i = 0 ; i < 10 ; i++ ) { break ; } return 0; }
Message ID: omp_structblkviolation
Index variable of OpenMP for must have a signed integer type Example of code that generates the message:
int NE_C2_4_1_3() { unsigned int i; #pragma omp for for (i = 0 ; i < 10 ; i++ ) { } return 0; }
Message ID: omp_forbadindxtype
"section" OpenMP pragma must appear immediately inside a "sections" block. Example of code that generates the message:
int NE_C2_4_2_1() { #pragma omp sections { ; } #pragma omp section { } return 0; }
Message ID: omp_sectionoutsidesections
Example of code that generates the message:
int NE_C2_6_5_1() { int i = 5; int & n = i; #pragma omp parallel { #pragma omp flush (n) } return 0; }
Message ID: omp_varhasreftype
OpenMP directive ordered must not be in the dynamic extent of a for directive that does not have ordered clause specified. Example of code that generates the message:
int NE_C2_6_6_1() { int i; #pragma omp for for (i=0; i<10 ; i++) { #pragma omp ordered { } } return 0; }
Message ID: omp_nonorderedfor
A threadprivate directive must appear at file scope or namespace scope, must appear outside of any definition or declaration. Example of code that generates the message:
int a=0; class A { #pragma omp threadprivate ( a ) }; int NE_C2_7_1_1b() { return a; }
Message ID: omp_nonfilethreadprivate
Threadprivate directive must lexically precede all references to any of the variables in its list. Example of code that generates the message:
int a = 1; void foo() { a--; } #pragma omp threadprivate ( a ) int NE_C2_7_1_1c() { return a; }
Message ID: omp_threadprivateprecederef
A threadprivate variable must not have a reference type. Example of code that generates the message:
int a; int & b = a; #pragma omp threadprivate (b) int NE_C2_7_1_6a() { return 0; }
Message ID: omp_varinprivateref
Example of code that generates the message:
class A; int foo(A & a) { #pragma omp parallel private (a) { } return 0; } int NE_C2_7_2_1_3() { return 0; }
Message ID: omp_varinprivateincomplete
A threadprivate variable must not appear in any clause other than the copyin, schedule, or the if clause. As a result, they are not permitted in private, firstprivate, lastprivate, shared, or reduction clauses. They are not affected by the default clause. Example of code that generates the message:
int a; #pragma omp threadprivate( a ) int NE_C2_7_1_4a() { #pragma omp parallel private (a) { } return 0; }
Message ID: omp_threadprivatewrongclause
Unless it has a class type with a mutable member, a variable specified in a private clause must not have a const-qualified type. Example of code that generates the message:
class A { public: A(); }; int NE_C2_7_2_1_2() { const A a; #pragma omp parallel private(a) { } return 0; }
Message ID: omp_varmustnotbeconstqual
Example of code that generates the message:
int NE_C2_7_2_5_2() { int a; #pragma omp parallel default (none) { a=1; } return 0; }
Message ID: omp_defaultviolated
Type of the variable specified in reduction clause must be valid for the reduction operator except that pointer types are never permitted. Example of code that generates the message:
class A { }; int NE_C2_7_2_6_1a() { A a; #pragma omp parallel reduction(+:a) { } return 0; }
Message ID: omp_reductionbadtype
Variable specified in reduction clause must not have a const-qualified type. Example of code that generates the message:
int NE_C2_7_2_6_2() { const int a = 0; #pragma omp parallel reduction (+: a) { } return 0; }
Message ID: omp_constreduction
No variable may be specified in more than one clause, except that a variable can be specified in both a firstprivate and a lastprivate clause. Example of code that generates the message:
int NE_C2_7_2_6_4() { int a = 0; #pragma omp parallel shared (a) reduction (+: a) { } return 0; }
Message ID: omp_dupclause
A variable that is specified in copyin clause must be a threadprivate variable. Example of code that generates the message:
int x; int NE_C2_7_2_7_2() { #pragma omp parallel copyin (x) { } return 0; }
Message ID: omp_copyinnotthreadprivate
Critical directives with the same name are not allowed to be nested inside each other. Example of code that generates the message:
int NE_C2_9_3_1() { #pragma omp critical { #pragma omp critical { } } return 0; }
Message ID: omp_badnestingcritical
for, sections, and single directives are not permitted in the dynamic extent of critical, ordered, and master regions. Example of code that generates the message:
int NE_C2_9_4_4() { #pragma omp master { #pragma omp for for ( int i=0 ; i < 10 ; i++ ) { } } return 0; }
Message ID: omp_badnestingregion
for, sections, and single directives that bind to the same parallel are not allowed to be nested inside each other. Example of code that generates the message:
int NE_C2_9_2_1() { #pragma omp parallel { int i; #pragma omp for for (i=0 ; i < 10 ; i++) { #pragma omp sections { ; } } } return 0; }
Message ID: omp_badnestingparallel
The smallest statement that contains a flush directive must be a block (or compound-statement). Example of code that generates the message:
int NE_C2_6_5_2() { int i = 5; #pragma omp parallel { if ( i > 0 ) #pragma omp barrier } return 0; }
Message ID: xomp_mustbeblock
When schedule(runtime) is specified, chunk_size must not be specified. Example of code that generates the message:
int NE_C2_4_1_9() { int i; #pragma omp for schedule(runtime, 2) for (i=1;i<10;i++) { } return 0; }
Message ID: omp_chunksizemustnotbespecified
Example of code that generates the message:
int main(void) { #pragma omp for default(none) for (int i = 0 ; i < 10 ; i++ ) { } return 0; }
Message ID: omp_badclause
Skip the rest of the current pragma up to the new line. It is used to separate OpenMP related error recovery from the C++ specific error recovery. Example of code that generates the message:
int main(void) { #pragma omp for default(none) for (int i = 0 ; i < 10 ; i++ ) { } return 0; }
Message ID: omp_skip
Line directives must specify positive integers. Example of code that generates the error message:
#line 0 "file.cc"
Message ID: poslinenum
Variables that are private (firstprivate/lastprivate) within a parallel region cannot be specified in a private (firstprivate/lastprivate) clause on an enclosed work-sharing or parallel directive. As a result, variables that are specified private on a work-sharing or parallel directive must be shared in the enclosing parallel region. Example of code that generates the message:
int main() { int i,j; #pragma omp parallel private(j) { #pragma omp for lastprivate(j) for (i=0; i<10; i++) j++; } return 0; }
Message ID: omp_varalreadyprivate
Example of code that generates the message:
int NE_C2_9_2_1() { #pragma omp parallel { int i; #pragma omp for for (i=0 ; i < 10 ; i++) { #pragma omp sections { ; } } } return 0; }
Message ID: omp_badnesting
A variable that is specified in reduction clause must be shared in the enclosing context. Example of code that generates the message:
int main() { int i; #pragma omp parallel private(i) #pragma omp sections reduction(+:i) { i++; } return 0; }
Message ID: omp_reductionnotshared
This message is displayed when general syntax error is discovered in OpenMP pragma. Example of code that generates the message:
int main() { #pragma omp parallel private { } return 0; }
Message ID: omp_badlyformedomppragma
Control expression of OpenMP for must have canonical shape of the following form:
Message ID: omp_forbadcontrol
int main()
{
int i,j=0;
#pragma omp parallel for
for (i=0; j<10; i++) {
}
return 0;
}
Only none or shared are valid values for default clause. Example of code that generates the message:
int main() { int i; #pragma omp parallel default(private) { i++; } return 0; }
Message ID: omp_baddefault
The schedule clause kind must be one of - static, dynamic, guided, runtime. Example of code that generates the message:
int main() { int i; #pragma omp parallel for schedule(normal,1) for (i=0;i<10;i++) { } return 0; }
Message ID: omp_badschedulekind
Example of code that generates the message:
int main() { #pragma omp unknown return 0; }
Message ID: omp_badomppragma
OpenMP parallel and worksharing constructs are require to be followed by structured block. A structured block is a statement that has a single entry and a single exit. No statement that causes a jump into or out of the block is allowed. A structured block cannot contain a return, goto, break or continue statement that causes control to flow out of the block. Example of code that generates the message:
int foo() { #pragma omp parallel { return 1; } }
Message ID: omp_strblkviolation
Iteration expression of OpenMP for must have a canonical shape. Example of code that generates the message:
int main() { int i; #pragma omp parallel for for (i=0; i<10; foo(&i)) { } return 0; }
Message ID: omp_forbaditer
Init expression of OpenMP for must have canonical shape of the following form:
Message ID: omp_forbadinit
int main() {
int i=0;
#pragma omp parallel for
for (; i<10; i++) {
}
return 0;
}
A for statement must follow an OpenMP for pragma. Example of code that generates the message:
int main() { int i=0; #pragma omp parallel for { while( 0 ){ i++; } return 0; }
Message ID: omp_forbadfollow
Declaration of \"%1\" is syntactically ambiguous, but the standard interprets it as a function declaration. However, programmers often intend an object declaration. To avoid confusion, rewrite the declaration in a syntactically unambiguous manner. Example of code that generates the warning message:
struct T { }; T t( T() ); // t is a functionSuggested alternatives that are syntactically unambiguous:
T t( (T()) ); // t is an object (types cannot have extra parens) T t = T(); // t is an object (assignment-style initialization) T t( T(*)() ); // t is a function (explicit function pointer)
Message ID: ambigfuncdecl
A chunksize must be an integral loop invariant positive non-zero value. Example of code that generates the error message:
#pragma omp for schedule (static, 0)
Message ID: badchunksize
Loop indices within parallel regions must be private to the region. Example of code that generates the message:
int main() { int i=0; #pragma omp parallel for shared(i) for(i=0; i<4; i++){ } return 0; }
Message ID: omp_sharedforindex
A class used in this file contains a virtual base class which has no non-static data members. Under certain circumstances this can result in virtual function calls going to the wrong function.
Message ID: warn_empty_virt_base
A reference return value should be an lvalue. The standard allows a function returning a reference to a rvalue to be written. However, if the value is actually used, the result is unpredictable.
Message ID: nonvarrefww
An attempt to call a pure virtual function from an object in which the function has not been overridden will always fail. A base-class pure virtual function will never be called via the virtual call mechanism. You must explicitly qualify the call, and you must provide a body for the function in a separate function definition. Example:
struct T { virtual int f() = 0; T() { f(); } // warning, pure virtual function called ~T() { T::f(); } // OK, virtual call mechanism bypassed void g() { f(); } // OK if g() called from derived-class object }; int T::f() { return 0; } // definition of pure virtual function
Message ID: pure_virtual_w
Critical directives with the same name are not allowed to be nested inside each other. Example of code that generates the message.
void main(void) { #pragma omp critical(foo) #pragma omp critical(foo) ; }
Message ID: omp_badcriticalnesting
A Java method that is declared native must be implemented with a C++ function. It is an error to supply a C++ verion of the method if it is not previously declared as a native method in the .class file.
Message ID: notjavanative
The result of passing a non-POD object as a variable argument is undefined.
A POD (Plain Old Data) object is one that has no user-declared constructors, no user-defined destructor, no user-defined copy assignment operator, no base classes, no virtual functions, no private or protected non-static data members, and no non-static data members of type pointer-to-member, non-POD-struct, non-POD-union or reference.
void foo(int, ...); struct T { T(); ~T(); }; extern T t; int main() { foo(1, t); // Warning }
Message ID: nonpodvarargw
The friend declaration did not have a class or function specified. Example of code that generates the error message:
namespace N { templatestruct B { }; } struct A { friend struct N::B; //should be an error here, B is a template, not a struct };
Message ID: wnofriendfield
Friend declaration declares a non-template function. Example of code that generates the warning:
template < class T > bool foo (T); template < class T1 > class BC_base_identifier { friend bool foo(T1); }; int main() { BC_base_identifierbi; foo(100); }
Message ID: nontmplfriend
valid arguments to #pragma dumpmacros are: defs, undefs, loc, conds, sys Example of code that generates the error message:
#pragma dumpmacros(definitions)
Message ID: prbadarg
Template nesting depth refers to specialization of a function template, only a non-template function is available. Example of code that generates the error message:
templatestruct A { void f(int); }; template<> template <> void A ::f(int) {} // extra spec
Message ID: mismatchtmpdepth
Assignment, initialization or cast may truncate data when porting to 64bit. Example of code that generates the error message:
long l; (int)l;
Message ID: truncwarn1
sign of data may be extended before being assigned to unsigned long when porting to 64bit. Example of code that generates the error message:
int i; unsigned long ul = i;
Message ID: signextwarn
long or unsigned long bitfield declaration may change bitfield packing when porting to 64bit. Example of code that generates the error message:
struct S { unsigned long b1:20; long b2:20; };
Message ID: bitfield64
a keyword is being defined. Example of code that generates the warning:
#define bool unsigned int
Message ID: nokeyworddefine
2nd and third operands can be converted to each other
struct S { S (int); operator int () const; }; int main (int i) { S s0(0); i ? s0 : 1; // ambiguous type conversions }
Message ID: questambigerr
A block-scope variable specified in threadprivate directive must be static. Example of code that generates the message:
int main() { #pragma omp parallel { int i; #pragma omp threadprivate(i) i = 50; } }
Message ID: omp_threadprivatenotstatic
A threadprivate directive for static block-scope variables must appear in the scope of the variable and not in a nested scope. Example of code that generates the message:
int main() { static int i; #pragma omp parallel { #pragma omp threadprivate(i) i = 50; } }
Message ID: omp_threadprivateinnested
Expression specified in if clause of OpenMP parallel must have scalar type. Example of code that generates the message:
int main() { struct { float val; } good = {3.62}; #pragma omp parallel if(good) good.val = 4.12; }
Message ID: omp_badiftype
Expression specified in num_threads clause of OpenMP parallel must have integer type. Example of code that generates the message:
int main() { int i = 0; #pragma omp parallel num_threads(3.62) i++; }
Message ID: omp_badnumthreadstype
A class definition cannot be specified in a template argument declaration. Example of code that generates the error message:
templateclass S{};
Message ID: noclassdef
The copyprivate clause must not be used with the nowait clause. Example of code that generates the message:
int main() { int i = 42; #pragma omp single nowait copyprivate(i) { i++; } }
Message ID: omp_badusecopyprivate
If a single directive with a copyprivate clause is encountered in the dynamic extent of a parallel region, all variables specified in the copyprivate clause must be private in the enclosing context. Example of code that generates the message:
int main() { int i = 1; #pragma omp parallel { i = 42; #pragma omp single copyprivate(i) { i++; } } }
Message ID: omp_notprivateincontext
const variables must be declared with declarator and intializer Example of code that generates the message:
const enum E1 {a, b}; // Error const enum E2 {c, d} x = c; // Okay
Message ID: badconstdecl
volatile variables must be declared with declarator Example of code that generates the message:
volatile enum E1 {a, b}; // Error volatile enum E2 {c, d} x; // Okay
Message ID: badvoldecl
init-declarator-list required with storage class specifier Example of code that generates the message:
register enum E4 { a4, b4 }; // Error register enum E5 { a5, b5 } e; // Okay
Message ID: badstgdecl
init-declarator-list is required in this type of declaration Example of code that generates the message:
typedef struct T { int i; }; typedef enum F { f1, f2 };
Message ID: declreq
Example of code that generates the error message:
struct A { friend static void foo(A arg); };
Message ID: storefrienderr
Example of code that generates the warning message:
#includeint main() { enum Shape { shape1=2, shape2}; enum Point { point1=4, point2}; Shape cylinder = shape1; Point uper = point2; if ( cylinder == uper ) // Warning cout << "Comparing different enum types" << endl; }
Message ID: diffenumtype
Message ID: demxarchv8plus
Example of code that message struct S { int f1(int = f2()); int f2(int = f1()); };
Message ID: recurseindefault
A virtual function cannot be declared as a friend function. Example of code that generates the error message:
void foo() { return; } void goo() { return; } class A { virtual friend void foo(); // ERROR virtual friend void A::goo(); // ERROR };
Message ID: virtfriendfunction
A Friend function has been declared using function name only. Example of code that generates the error message:
namespace N { void foo(char); void foo(); }; class A { friend N::foo; };
Message ID: friendfunc
Example of code that generates the warning message:
struct No_constructor { int i : 30; }; class Has_constructor { int j : 30; public: Has_constructor():j(-2){} // line 8: Warning }; int main() { struct No_constructor b = {1-2};// line 12: Warning b.i = -1.8; // line 13: Warning }
Message ID: negbitfield
Example of code that generates the warning message:
namespace N { templatestruct ap { ap(X* p = 0); }; }; using namespace N; class A { }; A* a; ap ap(a) ;
Message ID: baddeclare
Example of code that generate the warning message:
class A { }; main() { A a(10); #pragma omp parallel private(a) { ; } }
Message ID: nodefctor
Example of code that generates the warning:
templateclass A { ... }; class A ; // warning: ignored template<> class A ; // declare explicit specialization template class A ; // explicit instantiation directive
Message ID: oldspecialdecl
Example of code that generates the warning:
__thread void func(); struct type { __thread void func(); };
Message ID: nothreadfuncs
Example of code that generates the warning:
int changed; __thread int changed;
Message ID: threaddeclfirst
Dynamic initializers are not suppored with __thread variables. Dynamic initializers may arise from non-trivial constructors, destructors, base classes, or non-constant initializer expressions. Example of code that generates the warning:
struct nontrivial_constructor { nontrivial_constructor(); }; __thread nontrivial_constructor unsupported1; struct nontrivial_destructor { nontrivial_destructor(); }; __thread nontrivial_destructor unsupported2; struct nontrivial_base : nontrivial_constructor { }; __thread nontrivial_base unsupported3; extern int func(); __thread int unsupported4 = func();
Message ID: threaddyninit
Example of code that generates the warning:
void func() { __thread int a; }
Message ID: noautothread
Example of code that generates the warning:
templatestruct traits { typedef T ty; }; template struct tn { typedef typename traits ::ty tn_ty; }; template <> struct tn { typedef typename traits ::ty tn_ty; };
Message ID: explctspectypename
Example of code that generates the warning:
class A { private: int a; } ; struct B: A { private: A::a; // Warning for standard mode } ;
Message ID: inaccessible_anach
Variables that are private withing a parallel region cannot be specified in the reduction clause on a work-sharing directive that binds to the parallel construct. Example of code that generates the message:
int main() { int i; #pragma omp parallel private(i) #pragma omp sections reduction(+:i) { i++; } }
Message ID: omp_cant_be_in_private
Variables that appear in the reduction clause of a parallel directive cannot be specified in the reduction clause on a work-sharing directive that binds to the parallel construct. Example of code that generates the message:
int main() { int i; #pragma omp parallel reduction(+:i) #pragma omp sections reduction(+:i) { i++; } }
Message ID: omp_cant_be_in_reduction
Unless it has a class type with a mutable member, a variable specified in a private clause must not have a const-qualified type. Example of code that generates the message:
class A { public: A(); }; int NE_C2_7_2_1_2() { const A a; #pragma omp parallel private(a) { } return 0; }
Message ID: omp_varmustnotbeconst_qual
If a section contains more than one statement, they must be placed in {} Example of code that generates the message:
#pragma omp sections { // optional #pragma omp section x = 5; y = 10; }
Message ID: omp_badsectionstructure
The friend function name did not have a template declared in the nearest namespace or has it in the current class. Example of code that generates the error message:
#includenamespace M { template < class T > void i(T); class A { template < class T > void i(T); friend void i< > ( int ); //ill-formed - A::i }; template< typename T > class Bar { std::valarray< T > fVA ; friend std::valarray< T > const Fu< >( Bar< T > const & ) ; // Fu<> has no declaration in a namespace M } ; };
Message ID: wnotempdecl
External linkage is not available for inline functions. Example of code that generates the message:
int f(); inline int f() { return 0; }
Message ID: wbadlinkage_w
Example of code that generates the warning:
static __symbolic int variable; static __hidden int function() { __global int stackvar; }
Message ID: ldscopeonlyextern
Linker scopes may only be more restrictive on subsequent declarations. Linker scope __hidden is more restrictive than __symbolic, which is more restrictive than __global, which is more restrictive than unspecified linker scope. Example of code that generates the warning:
__hidden int function(); __symbolic int function();
Message ID: ldscoperestrict
Example of code that generates the warning:
__symbolic int function() { } __hidden int function();
Message ID: ldscopechanged
Example of code that generates the warning:
char c[100000]; short i = sizeof(c);
Message ID: truncwarn2
A class with a reference member must have a user-defined constructor Example of code that generates the error message:
struct S { int x&; };Message ID: refmemnoconstr
The pch file being used does not have the correct magic number
Message ID: pchbadmagicnumber
The pch file being used has an incorrect format string in the front matter
Message ID: pchbadformatstr
The pch collect and use mode compiler release strings are incompatible
Message ID: pchbadreleasestr
The pch file was expected to contain defines
Message ID: pchexpdefines
The pch file was expected to contain undefs
Message ID: pchexpundefs
The list of defines in the pch collect and use modes is not the same
Message ID: pchbaddefines
The list of undefs in the pch collect and use modes is not the same
Message ID: pchbadundefs
The viable prefix in the pch collect and use modes is not the same PRE>
Message ID: pchbadviableprefix
Invalid template nesting depth Example of code that generates the error message:
template <class X> template <class Y> void foo(); // ERROR: invalid template nesting depth struct S { template <class X> template <class Y> void foo(); // ERROR: invalid template nesting depth }
Message ID: badnesttmpl
Variables that are used for loop control in parallel for are implicitly declared private, as a result shared() clause has no effect on such variables. Example of code that generates the message:
int main() { int i,j; #pragma omp parallel for shared(i,j) for (i=0; i<10; i++) j = i; ; return 0; }
Message ID: omp_shared_control_var
Static non-POD decl not allowed in parallel region Example of code that generates the error message:
class A {public: int i; A(){i = 10;};}; #pragma omp parallel { static A a; ; }
Message ID: omp_staticclassdecl
Example of code that generates the warning:
unsigned short bar[] = U"é";
Message ID: ustronlyascii
Example of code that generates the warning:
unsigned short bar[] = U"\351";
Message ID: ustrnoescape
Possibly missing or badly placed #pragma hdrstop or -xpchstop point
Message ID: pchbadstoppoint
Only comments and certain preprocessor directives allowed in viable prefix
Message ID: pchbadviablepref
Too many open files, maybe a file including itself
Message ID: toomanyopenfiles
There was an attempt to cast away const or volatile. Examples of code that generates the error message:
class B { virtual void foo(); }; class A: public B {}; const B * pb = new A; A *pa1 = dynamic_cast<A*>(pb); // ERROR: dynamic_cast casts const pb to a non-const pointer. extern int *const** p1; int **const* p2 = reinterpret_cast<int **const*>(p1); // ERROR extern volatile int *pi; int *pi2 = static_cast<int*>(pi); // ERROR
Message ID: castawayconst
A threadprivate directive must appear outside of any definition or declaration. Example of code that generates the message:
class A { int a; #pragma omp threadprivate ( a ) };
Message ID: omp_badthreadprivate
An explicit template argument list is not allowed in a primary template declaration Example of code that generates the message:
templatevoid bar (); template void bar ();
Message ID: wexpltemplid
An atomic pragma must be followed by a single expression statement. Example of code that generates the message:
#pragma omp atomic { // '{' not allowed i++; }
Message ID: omp_badatomicfollow
Function has been used before it's declaration as inline. This means that all preceding calls will be processed as extern. Subsequent calls will be inlined. Example of code that generates the error message:
class A { public: void foo (); }; int main () { A a; a.foo(); } inline void A::foo () {}
Message ID: inlafteruse
Comparison between signed and unsigned types. Example code that generates the message:
int foo(unsigned ui, int i) { if ( ui < i ) return 0; else return 1; }
Message ID: wunsignedcomp
An iteration of a loop with a for construct must not execute more than one ordered directive. Example of code that generates the message:
int main(){ #pragma omp for ordered for (int q = 0; q < 100; q++) { #pragma omp ordered { int a; } #pragma omp ordered { int b; } } }
Message ID: omp_badordered
A function or a class declared to be a friend to a local class has not been found in inner-most enclosing non-class scope. Example of code that generates the warning:
void global_f(); class A {}; void f() { extern void another_f(); class B {}; class local_class { friend void f(); // warning friend void global_f(); // warning friend void another_f(); // Ok friend class A; // warning friend class B; // Ok }; }
Message ID: badlocalfrienddecl
There are constraints on where certain OpenMP directives may appear Example of code that generates this message:
void foo() { int i = 0; label: #pragma omp barrier i++; goto label; }
Message ID: omp_mustbeblock
The barrier and flush standalone directives may not be labeled Example of code that generates this message:
main() { int i = 0; #pragma omp parallel { label: #pragma omp flush i++; goto label; } }
Message ID: omp_no_label
The pch file was expected to contain srcdir
Message ID: pchexpsrcdir
The source directory in the pch collect and use modes is not the same
Message ID: pchbadsrcdir
The pch file was expected to contain cwd
Message ID: pchexpcwd
The current directory in the pch collect and use modes is not the same
Message ID: pchbadcwd
The pch file was expected to contain options
Message ID: pchexpoptions
The options in the pch collect and use modes are not the same
Message ID: pchbadoptions
Since a try must be caught by the thread that threw the exception OpenMP constructs are not permitted withing try blocks Example of code that generates this message:
try { #pragma omp parallel { throw a(); } } catch(...) { printf("in catcher\n"); } }
Message ID: omp_in_guarded
The standard requires that an omp sections construct be followed by { section-sequence } Example of code that generates this message:
#pragma omp parallel sections i = i + 5;
Message ID: omp_nosectionscope
See the OpenMP API for the rules that govern legal atomic expressions Example of code that generates this message:
#pragma omp atomic i = i + 5;
Message ID: omp_badatomicexpr
The standard prohibits modifying the value of an OpenMP for index variable within the loop Example of code that generates this message:
#pragma omp parallel for for (i = 0; i < 10; i++) { i = i + 5; }
Message ID: omp_forindexmod
Friend declaration of template must have the same number of parameters Example of code that generates the error message:
templateclass X { public: X() { } private: template friend class X ; // ERROR template friend class X ; // Ok }; X i;
Message ID: nomatchfrienddecl
Types cannot be declared in anonymous union Example of code that generates the error message:
static union { struct S { // ERROR int i; } s; int j; };
Message ID: anonnotype
Friend function can be defined only in a non-local class Example of code that generates the error message:
void f() { class A { friend int g() { return 1; }; // ERROR }; };
Message ID: locfriendfunc
invalid __declspec syntax Example of code that generates the error message:
extern __declspec dllimport) int bar;
Message ID: declspecsyntax
__declspec attribute identifer was unexpected Example of code that generates the error message:
extern __declspec(foo) int bar;
Message ID: declspecident
The definition of structured block states that a labeled statement is not a structured block. Example of code that generates the message:
#pragma omp sections { // optional #pragma omp section label: goto label; }
Message ID: omp_labeledisntstructured
The definition of structured block states that a declaration statement is not a structured block. Example of code that generates the message:
#pragma omp sections { // optional #pragma omp section int a = 1; }
Message ID: omp_declisntstructured
A match of the function call among the overloaded functions and/or templates could not be found. Example of code that generates the error message:
struct S { int &r; }; int main() { struct S *x = new S(0); // ERROR: constructor S::S(int) not found };
class A { public: int i; A(); A(int a, int b); }; void foo(){ A a(1,2,3); // ERROR: passing three arguments to constructor, no match }
Message ID: nomatchoverin
The compiler found unknown or misspelled pragma Example of code that generates the warning message:
#pragma some_unknown // Unknown pragma int main() { #pragma opm for // Misspelled pragma for ( int i = 0; i < 10; i++ ) { } return 0; }
Message ID: unknownpragma
Cannot specialize an inner template without also specializing the outer template Example of code that generates the error message:
templatestruct S { template struct I; template void foo(); }; template template <> struct S ::I ; // ERROR template template <> void S ::foo (); // ERROR
Message ID: nestexplspec
Explicit specialization can be declared in namespace scope only Example of code that generates the error message:
struct S { templatestruct I; template void foo(); template <> struct I ; // ERROR template <> void foo (); // ERROR };
Message ID: badexplspec
Explicit specialization of a template must be declared in the same namespace as template Example of code that generates the error message:
namespace N { templatestruct S {}; template void foo(); } template <> struct N::S ; // Warning template <> void N::foo (); // Warning
Message ID: badexplspecdecl
Explicit specialization may be defined in a namespace containing declaration or enclosing namespace with declaration Example of code that generates the error message:
namespace N { templatestruct S {}; template void foo(); template <> struct S ; template <> void foo (); } namespace M { template <> struct N::S {}; // Warning template <> void N::foo () {} // Warning }
Message ID: badexplspecdef
Anonymous structs cannot be nested. Example of code that generates the error message:
struct S { struct { int j; union { struct { unsigned int word0; unsigned int word1; } ; } ; }; };
Message ID: nestedanonstruct
Template qualifier keyword cannot be used outside of a template
Message ID: badtmplkey
A template argument for template template-parameter must be the name of class template. Example of code that generates the error message:
template <template <typename T> class C> struct S { }; struct S1 {}; S<S1> s; // ERROR: S<C<T> > requires class template argument
Message ID: temargnotemp
Index variable of OpenMP for loop may not appear in a threadprivate directive Example of code that generates the message:
int foo() { static int i; #pragma omp threadprivate(i) #pragma omp for for (i = 0 ; i < 10 ; i++ ) { } return 0; }
Message ID: omp_indx_threadprivate
The type has not been defined correctly, or no storage has been allocated. Example of code that generates the error message:
void i; // ERROR: the type "void" is incomplete void *i; // OK, *i is a pointer type void class A; A a; // ERROR class B { friend void A::f(); // ERROR: f is a member of incomplete type }; int xp[]; // ERROR: The type "int[]" is incomplete. struct x y; // ERROR: The type "x" is incomplete. int main() { xp [1] = 1; return 0; }
Message ID: incompnolink
static templates are not allowed with -instances=extern, 'static' ignored
Message ID: templ_static_extern
large __thread objects are not allowed in medium model
Message ID: tls_large_obj
reference to static is not allowed in templates, try using -features=tmplrefstatic if this is intended to work Example of code that generates the error message:
static int bar( int ) { return 0; } template< class T > int foo( T arg ) { return bar( arg ); } int main() { return foo(1); }
Message ID: templ_static_ref
The __thread specifier is not supported on Linux
Message ID: nothreadlinux
Template options file is not supported and is being ignored
Message ID: notmplopts
The size in an array declaration cannot be negative. Example of code that generates the error message:
int ia[-5];
Message ID: badarraysizeneg
The zero-length array is allowed with -features=zla option only. Example of code that generates the error message:
int ia[0]; // Error without -features=zla option
Message ID: badarraysizezero
The specified attribute is unknown or unsupported and will be skipped. Example of code that generates this message:
int __attribute__((unsupportedattr)) a;
Message ID: attrskipunsup
The attribute syntax requires an attribute name to be specified Example of code that generates this message:
int __attribute__(( 8 ))
Message ID: noattrname
A _Pragma expression takes one string literal argument
Message ID: pragmasyntax
Some names can be defined only in restricted scopes: 1. The definition for a static data member shall appear in a namespace scope enclosing the member s class definition. 2. A member function definition that appears outside of the class definition shall appear in a namespace scope enclosing the class definition. Example of code that generates the error message:
namespace NS1 { void func (); extern int var; }; class C { public: void func (); static int data; }; namespace NS2 { // The following cannot be defined in this scope void NS1::func () {} int NS1::var; void C::func () {} int C::data; };
Message ID: definscope
The following constraints are impossible: 1. Contains both '+' and '=', 2. Contains '#'. Example of code that generates the error message:
asm ("cmd" : "+="(a) ); asm ("cmd" : "#"(a) );
Message ID: inlasmimcon
The operand of "m", "o", "v" and "p" constraints must be an lvalue.
Message ID: inlasmconlv
The struct, union and class type operands are allowed only for "m", "o", "v" and "p" constraints. Example of code that generates the error message:
union U {}; U u; asm ("cmd" : "=r" (u));
Message ID: inlasmoptyp
Type used as a constructor name should be the same as class name. Example of code that generates the error message:
template <typename T1, typename T2> struct S { S<T1<(); }; S<int, int> v;
Message ID: tmplconstrname
The identifier is used in declaration specifier and immediately redefined in the declarator Example of code that generates the error message:
class A {}; class B: public A{ A A; // base class name redefinition };
Message ID: strangeidredef
You cannot define a new type within a "typeof" expression. Example of code that generates the error message:
__typeof__(struct t{}) s;
Message ID: nodefintypeof
A \"typeof\" argument must be an expression or a type. Example of code that generates the error message:
__typeof__({}) v;
Message ID: badtypeofarg
typeof may not be applied to an overloaded function. Example of code that generates the error message:
int f(int); char f(char); typeof(f) p;
Message ID: typeofovrlfunc
Friend declarations shall not declare partial specializations. Example of code that generates the error message:
templatestruct S1 {}; class S2 { template friend struct S1 ; };
Message ID: psfriend