LSCT C++ Translator Messages

This chapter describes diagnostic messages generated by the SAS/C C++ Development System and SAS/C C++ Cross-Platform Development System. Translator diagnostics identify program errors such as missing or misplaced tokens, extraneous tokens, and type mismatches but cannot tell you whether your programming logic is correct.

Each diagnostic includes the message number and text, the error level (for example, ERROR or WARNING), an explanation of the message, and if possible, a solution.

C++ diagnostics have the form

   LSCT[num] [severity]: [message text]
If the translator generates one or more error messages, the source program is incorrect and translation is terminated without producing a compiled output file. Warning messages, on the other hand, indicate potential problems which may not affect how the program is compiled, linked, and executed.

You should fix the errors in the order they appear on your display or listing. Sometimes a single error in your program can result in multiple error messages. The translator attempts to pinpoint the line number in which the error occurred, but occasionally, the error may occur in a line before the line number given by the translator.

Note: Some messages refer you to additional information in the reference section of Bjarne Stroustrup's The C++ Programming Language, Second Edition (CPL2).

The C++ message prefix LSCT has been omitted from the descriptions below.

LSCT Messages

101

ERROR: Illegal token.

Explanation

A symbol that is not recognized as a valid token has been detected in the input. For example, you may have a symbol that you intended to be a C++ identifier, but that contains a character not permitted in identifiers. For instance, symbols cannot have a number as the first character of the identifier.

102

ERROR: Can't find file: [filename].

Explanation

The file specified in a #include directive cannot be found.

103

ERROR: Invalid filename.

Explanation

The filename in a #include directive must be enclosed in double quotes ("") or angle brackets (<>).

104

ERROR: End of file encountered in comment.

Explanation

The end of the source file has been detected while a comment was being processed (and before the comment terminator was seen).

105

WARNING: Invalid escape sequence.

Explanation

An invalid escape sequence has been detected. An invalid escape sequence is a backslash () followed by a character not valid in such a context. For example, z is not a valid escape sequence.

106

ERROR: Illegal preprocessor directive.

Explanation

A # character followed by a symbol not recognized as a valid preprocessor directive has been detected. You may have misspelled the directive.

107

WARNING: Extra token(s) after preprocessor directive.

Explanation

A #if, #else, or #endif directive has been followed by some text not within a comment.

108

ERROR: Missing identifier in preprocessor context.

Explanation

An identifier is required in the given preprocessor context, but is not present. For example, if a line at your program is #if defined instead of #if defined myfunc, this message is issued.

109

ERROR/WARNING: Redefinition of preprocessor symbol: [symbol].

Explanation

A previously defined symbol has been redefined. If the definitions are not the same, this is an error.

110

ERROR: Missing ')' in macro call.

Explanation

An occurrence of a left parenthesis in a macro call has not been matched by a right parenthesis.

111

ERROR: Missing argument to preprocessor macro.

Explanation

A preprocessor macro has been called with fewer arguments than the macro requires. Check the definition of the macro to determine which arguments are missing.

112

ERROR: Missing comma in preprocessor expression.

Explanation

A comma is required to separate the arguments in a definition or call of a function-like preprocessor macro.

113

ERROR: Illegal operator in preprocessor context.

Explanation

The preprocessor has detected an operator that it cannot understand. Examples of operators that are illegal in the preprocessor context are: ++, --, . , and ->.

114

ERROR: Missing operand in preprocessor context.

Explanation

An operand was expected but not found.

115

ERROR: Illegal expression in preprocessor context.

Explanation

The preprocessor has encountered an expression it cannot understand. For example, an operand may be expected but is not present, or the operand is of a non-integral type (for example, a floating-point constant).

116

ERROR: Preprocessor number not a true number.

Explanation

A token beginning with a digit resembles an integer or floating-point constant, but is not correct. For example, you may have mistyped a digit in a hexadecimal constant or mistyped a floating-point exponent field.

117

ERROR: Integer required in preprocessor expression.

Explanation

A non-integer operand has been detected in a preprocessor expression. The logical operators (!, ||, and &&) require integral operands.

118

ERROR: Extra #else or #elif.

Explanation

A #else or #elif directive has been found without a matching #if directive.

119

ERROR: Extra #endif.

Explanation

A #endif directive has been found without a matching #if directive.

121

ERROR: Invalid #line format.

Explanation

The preprocessor has encountered an invalid #line directive. The form of the #line directive is
#line number "string"
where number must be an integer constant and "string" must be enclosed in double quotes.

122

ERROR: Missing parenthesis in preprocessor expression.

Explanation

A beginning left parenthesis has been detected in an expression, but it was not matched by a right parenthesis.

123

ERROR: Illegal use of # operator.

Explanation

The identifier following the # operator is not an argument to the macro being defined.

124

ERROR: #error directive.

Explanation

The preprocessor has encountered a #error directive. This message is issued whenever a #error directive is encountered.

125

ERROR: Illegal ## expression.

Explanation

Either the first or second operand of the ## operator is missing. This may happen if the ## expression begins or ends the line.

126

ERROR: Illegal operand of ## operator.

Explanation

An operand of the ## expression is not an identifier. You may have misspelled the identifier.

127

ERROR/WARNING: Unterminated string or character constant.

Explanation

A string (starting with a double quote) or a character constant (starting with a single quote) was begun but not terminated.

128

WARNING: No [filename] include file directories specified.

Explanation

A #include directive was found, but no locations were available for the translator to find header files. See the operating system specific information about running the translator to determine how to specify header file locations.

129

ERROR: Character literals must contain at least one character.

Explanation

Two consecutive single quotes were found with no intervening characters. Character literals must have at least one character between the single quotes.

130

ERROR: Unterminated preprocessor conditional.

Explanation

The end of the source file was reached while a conditional preprocessor directive (such as the #elif directive) was pending. One or more #endif directives are missing.

131

ERROR: Integer value out of range.

Explanation

The value of an integer constant or the result of an operation on integers is either too large or too small to be represented. Frequently this is caused by a multiplication or division of two integers.

132

ERROR: Constant too large for [data-type].

Explanation

The constant is too large to fit into the named data type.

134

ERROR: Illegal use of ## operator.

Explanation

The token created by the ## operator was not a valid preprocessor token. This may occur, for instance, when an operator token is pasted to an identifier token.

180

Warning: More than two filename arguments (extras ignored): [filename].

Explanation

The C++ translator expects two filename options (options without a leading dash) {endash} the first, the input filename, and the second, the output filename. Further filenames are ignored. This message applies only to the SAS/C C++ Cross-Platform Development System.

181

Warning: Invalid [option-type] option (ignored): [option-name].

Explanation

The C++ translator does not recognize this option or sub-option.

182

WARNING: No such message #[message-number], in option [option-name]. Option (ignored).

Explanation

The given option contained a message number that is not recognized by the C++ translator.

183

WARNING: Cannot negate the [option-name] option (ignored).

Explanation

The given option cannot be negated.

184

ERROR: Cannot [operation] the [file-type] file named '[filename]'.

Explanation

The given operation (open, read, or close) could not be performed on the given file.

185

ERROR: Cannot construct the default [operation] filename from the [operation] filename '[filename]'.

Explanation

The given operation could not be performed on the given file. (This message applies only to the SAS/C C++ Cross-Platform Development System.)

186

WARNING: Option [option-name] ignored because it is incompatible with option [option-name].

Explanation

The first option is incompatible with the previously specified second option.

187

ERROR: Cannot use output file [filename] because it has a record length of one(1).

Explanation

Output files must have a record length of at least two (2). (This message applies only to the native 370 SAS/C C++ Development System.)

188

WARNING: Invalid SNAME: [section-name].

Explanation

SNAMES must be 1-7 valid C/C++ identifier characters. (This message applies only to the native 370 SAS/C C++ Development System.)

190

ERROR: Invalid [filename] fileid: [id].

Explanation

The given filename was either not specified, incorrectly specified, or could not be generated. (This message applies only to the native 370 SAS/C C++ Development System.)

200

ERROR/WARNING: Syntax error [more-explanation].

Explanation

A syntax error has been detected. There are many forms of message #200. The amount of information provided in these messages is dependent upon the context in which the error occurs.

Because any #pragma not recognized by an implementation must be ignored, diagnostics pertaining to #pragma map and #pragma linkage are issued as warnings rather than errors. However, you should treat them as errors because no action is taken on a faulty #pragma of this sort.

205

ERROR: Newline within string or character literal.

Explanation

The newline character (indicating an end of line) has been found within a string literal or character literal. Usually this occurs when a terminating single quote or double quote has been omitted from the literal.

206

ERROR: Bad character in input [hex-number].

Explanation

The specified character has been detected in the input and is not an acceptable character for a token. Normally this condition occurs only if your source file has had odd characters inserted in it, perhaps as a result of uploading or downloading the file from one machine to another.

207

WARNING: Asterisk found as first character of C++ style comment.

Explanation

You may have made an error in starting the comment. Check that it begins as a C style comment (/* */) instead of a C++ style (//) comment.

208

WARNING: C style comment starting on line line-number never ends.

Explanation

There is no terminating */ sequence to the comment. Either you have forgotten the comment terminator or you intended the comment to be a C++ style comment.

319

ERROR: '[identifier]' not declared.

Explanation

The specified identifier [identifier} is not declared. It may be misspelled.

320

ERROR: No such class: '[identifier]'.

Explanation

The specified identifier is not a class, but is used in a place where a class name is required, such as before the :: operator or in a base-specifier-list.

321

ERROR: 'struct' or 'class' used on 'enum [identifier]'.

Explanation

The specified identifier is an enum tag, but the keyword struct or class was used instead of enum.

322

ERROR: 'enum' used on 'class [identifier]'.

Explanation

The specified identifier is a class tag, but the keyword enum was used instead of struct or class.

323

ERROR: '[identifier]' previously declared to be a [type-name].

Explanation

The specified identifier was previously declared to have some other type.

324

ERROR: '[identifier]' redefined.

Explanation

The specified identifier was previously defined in this scope.

325

ERROR: Scoped declaration in parameter list.

Explanation

The :: operator cannot be used in parameter lists.

326

ERROR: Label '[label-name]' not defined.

Explanation

The specified label appeared as the target of at least one goto statement in the previous function, but the label was never defined in the function. Labels are defined in a function using the label : statement notation.

327

ERROR: Label '[label-name]' previously defined.

Explanation

The specified label was defined more than once in the same function.

328

ERROR: Repeated keyword or type name: '[keyword]'.

Explanation

A keyword or type name was used more than once within a single declaration.

329

ERROR: Conflicting keywords or type names: '[keyword-1]' and '[keyword-2]'.

Explanation

An illegal combination of keywords or type names was used in this declaration.

330

ERROR: Must be integral, pointer, or member pointer.

Explanation

An expression of a non-testable type was used where a testable value is required. Testable types are all the integral, pointer and member-pointer types. Testable values are required as the first expression of a ?: operator and as the test for the if, while, do while, and for statements.

331

ERROR: Must be integral.

Explanation

An expression of a non-integral type was used where an integral valued expression is required. An integral value is required in a case label and in the test expression of a switch statement.

332

ERROR: No such conversion: to ([type]) from ([type] ).

Explanation

An illegal conversion was specified in a cast operator.

334

ERROR: Expression is not modifiable.

Explanation

You have tried to assign, increment, or decrement something that was not a modifiable lvalue.

335

ERROR: Invalid use of '&' address-of operator. [object].

Explanation

The address-of operator (&) was applied to an object that was not addressable. Examples of nonaddressable objects are bitfields and register variables. Also, you cannot take the address of an overloaded function except as an initializer.

336

ERROR: Cannot initialize [variable] with [initializer].

Explanation

The initializer is of a type that cannot be converted to the type of the variable it is initializing.

337

ERROR: Preprocessor error.

Explanation

The preprocessor has encountered an error that is beyond its capabilities to diagnose.

Action

Contact SAS/C Technical Support.

338

ERROR: Unexpected end of file.

Explanation

The parser reached the end of the input source before it expected to. This may occur during error recovery from a previous syntax error in the input source. Otherwise, it usually indicates that a closing brace (}) or semicolon (;) has been omitted at the end of your source.

339

WARNING: A non-lvalue array was converted to a pointer.

Explanation

Only arrays that are lvalues can be converted to pointers. Because the array is not converted to a pointer, operator [] should not be applied to it because operator [] requires a pointer. Also the array should not be assigned to a pointer variable. If you want only to access the array, you may ignore this warning. However, if you want to alter the value of an array element, you should treat this message as an error.

340

ERROR: The base name '[class-1]' is ambiguous in class '[class-2]'.

Explanation

The class [class-1] occurs more than once as a base of the second class, [class-2].

342

ERROR: Conversion from a virtual base class '[class-name]' to a derived class is not allowed.

Explanation

Virtual base classes cannot be converted, either explicitly or implicitly, to derived classes.

343

ERROR: Ambiguous conversion to integral type from 'class [class-name]'.

Explanation

The class has defined multiple conversions to an integral type.

344

ERROR: Ambiguous conversion to pointer from 'class [class-name]'.

Explanation

The class has defined multiple conversions to pointer.

345

ERROR: Ambiguous conversion to testable from 'class [class-name]'.

Explanation

The class has defined multiple conversions to one or more of arithmetic, pointer, or member-pointer types.

346

ERROR: Ambiguous conversion to derived member pointer.

Explanation

An ambiguous reference to the derived member-pointer has been found. Resolve the ambiguity by qualifying the pointer name with its class name.

347

ERROR: Ambiguous conversion of overloaded function pointer.

Explanation

An ambiguous reference to the overloaded function pointer has been found. Resolve the ambiguity by qualifying the function pointer name with its class name.

348

ERROR: Ambiguous conversion to class.

Explanation

Compiler found an ambiguous reference to the conversion to a class. For example, you may have a file-scope function that has the same name as a class (hence, the same name as the conversion function of that class).

349

ERROR: Ambiguous conversion.

Explanation

An ambiguous conversion has been specified. For example, a constructor and a function cannot have the same name.

350

ERROR: Ambiguous function call.

Explanation

The function name used in the call is ambiguous. For example, two classes using different functions with the same name may not have used a class name to qualify the function name called.

351

ERROR: Overloaded functions '[function-1]' and '[function-2]' used ambiguously in conditional expression.

Explanation

Two overloaded functions were used as the second and third operands to a conditional operator (?:). These overloaded functions have more than one function type in common. Cast one or both operands to the desired function pointer or member function pointer type.

352

ERROR: Ambiguous common base class: [class-name].

Explanation

The reference to the base class is ambiguous. Resolve the ambiguity by further qualifying each occurrence of this name.

353

ERROR: Ambiguous member name: [member-name].

Explanation

The expression used to refer to the member could refer to more than one function, object, type, or enumerator. Resolve the ambiguity by qualifying the member name with its class name.

354

ERROR: Non-static member '[member-name]' must be used with dot, arrow, or address-of operator.

Explanation

Non-static members can be used only in the following contexts:

355

ERROR: Value of an undefined class cannot be used.

Explanation

You have tried to dereference a pointer to an undefined class. A solution is to include the definition of the class before it is used.

356

ERROR: An array may not be the target of an assignment.

Explanation

Array assignment (that is, assignment of an array name) is not supported in C or C++.

357

ERROR: A function may not be the target of an assignment.

Explanation

Function assignment (that is, assignment to a function name) is not supported in C or C++.

358

ERROR: Cannot [operation] a pointer to [type].

Explanation

You cannot add to or subtract from a pointer to void, a function pointer, or a pointer to an undefined class. Nor can you use the indirection operator (*) on a pointer to void or a pointer to an undefined class. The error message explains which of these mistakes you have made.

359

ERROR: Typedef names cannot be declared in parameter lists.

Explanation

A typedef name has been encountered in a parameter list. Move the definition of the typedef name outside the parameter list (that is, to file scope).

361

ERROR: Cannot take the address of a member of virtual base class.

Explanation

The & operator cannot be applied to a member of a virtual base class.

362

ERROR: Invalid initializer.

Explanation

The initializer is of a type that cannot be converted to a type required by the variable it is initializing.

363

ERROR: Invalid use of void.

Explanation

Only functions or pointers can be declared void.

364

ERROR: Cast to undefined class not allowed.

Explanation

The class to which a cast is made must be previously defined. Also, for dynamic_cast, when casting to a class pointer, the class type must be previously defined.

365

ERROR: Cannot find offset into non-class.

Explanation

Only members of classes can have offsets.

366

ERROR: Cannot find offset into undefined class.

Explanation

A class must be defined before the offset of one of its members can be taken.

367

ERROR: Invalid use of the scope operator.

Explanation

The scope operator :: can be used only in such expressions as C3::mem or C1::C2::C3::mem, where C1 is a class in which class C2 is declared, C3 is a class declared in C2, and mem is a member of C3.

368

ERROR: Cannot find the offset of 'object'.

Explanation

It is illegal to take the offset of a member function, a static member or a bitfield member. In particular, because the number of bits in a bitfield may be less than the number of bits in a char, and its number of bits may not comprise an integral number of chars, a bitfield in C++ has no size.

369

ERROR: Cannot find offset because class '[class-name]' has no member named '[member-name]'.

Explanation

The second argument to the offset operation must be a member of the class specified in the first argument.

370

ERROR: Cannot take the size of an undefined class.

Explanation

A class must be defined before its size can be determined.

371

ERROR: Cannot dereference pointer to undefined class.

Explanation

A class must be defined before a pointer to an object of its type can be dereferenced.

372

ERROR: No such constructor.

Explanation

The constructor referred to does not exist.

373

ERROR: '[identifier]' previously declared as [type-1]. Cannot be defined as [type-2].

Explanation

A name declared using the union specifier cannot be defined using struct or class. Similarly, a name declared as struct or class cannot be defined using union.

374

ERROR: No such member '[member-name]'.

Explanation

The identifier referred to is not a class member.

375

ERROR: Member '[member-name]' redeclared.

Explanation

The specified member of the class has been declared more than once.

376

ERROR: '[identifier]' not a definable member.

Explanation

Only functions and static data members can be defined outside the class declaration.

377

ERROR: 'this' may occur only in a (non-static) member function.

Explanation

You cannot use the this keyword outside the context of a non-static member function.

378

ERROR: Cannot create a new value of a function.

Explanation

The new operator cannot be applied to a function type. Functions cannot be allocated by means of the new operator.

379

ERROR: Cannot create a new value of a reference.

Explanation

The new operator cannot be applied to a reference type. Because a reference type is not an object, a pointer to it could not be returned by operator new.

380

ERROR: Cannot create a new instance of an undefined class.

Explanation

A class must be fully defined before the new operator can be applied to it to create a new instance of the class.

382

ERROR: Missing array size in expression.

Explanation

One or more dimensions of the given array have not been specified.

383

ERROR: Class '[class-name]' has no default constructor.

Explanation

You cannot use operator new to allocate an array of class objects if the class does not have a default constructor.

384

ERROR: Cannot initialize new array.

Explanation

An array created by means of the new operator cannot be initialized by specifying a brace-enclosed initializer list.

385

ERROR: Cannot delete an object of an undefined class.

Explanation

The delete operator cannot be applied to an object whose class has not been defined.

386

ERROR: Length expression of array must be integral.

Explanation

The size of an array cannot be specified as a floating-point number.

387

ERROR: No match for call to function or overloaded operator.

Explanation

The argument list given for a function call did not match any of the possible parameter lists.

388

ERROR: Missing constructor body.

Explanation

A constructor declaration was followed by a colon (:), but no constructor body ({) was found after that.

389 ERROR: Non-virtual functions '[function-name]' cannot be declared pure.

Explanation

Only virtual functions can be declared pure.

391

ERROR: Uninitialized const identifier.

Explanation

A const identifier must have an explicit initialization.

392

ERROR: Uninitialized const identifier or reference: [identifier].

Explanation

A const identifier must be initialized explicitly. The declaration of a reference must contain an explicit initializer unless one of the following is true:

393

ERROR: Const identifier or reference member '[member-name]' must be initialized.

Explanation

A const identifier or reference must be initialized explicitly. This message is caused by a constructor for a class with a const or reference member where the const or reference member is not initialized with a mem-initializer in the constructor. This message is also output for aggregate initialization of a structure that does not initialize a reference member.

394

ERROR: Member '[member-name]' must have initializer, class `[class-name]' has no default constructor.

Explanation

If a class has a constructor (but does not have a default constructor), objects of that class must be initialized. A member is initialized by including a mem-initializer for it on each constructor for the class containing the member.

For example, if the type of X::a is a class with a constructor (but no default constructor) you receive this message if you omit the a(10) in the following code:

X::X() : a(10), b(11)

{ . . . }

395

ERROR: Base '[class-name]' must have initializer, class '[class-name]' has no default constructor.

Explanation

If a class has a constructor (but does not have a default constructor), it must be initialized. A base class is initialized by including a mem-initializer for it on each constructor for the derived class.

For example, if b is a base class of X and is a class with a constructor (but no default constructor), you receive this message if you omit the b(11) in the following code:

X::X() : a(10), b(11)

{ . . . }

396

ERROR: Virtual base class '[class-name]' must have initializer since class has no default constructor.

Explanation

If a class has a constructor (but does not have a default constructor) it must be initialized. A virtual base class is initialized by including a mem-initializer for it on each constructor for the derived class. The example in message #395 is applicable in the virtual base class case as well.

397

ERROR: '[identifier]' is not a direct base class or member of class '[class-name]'.

Explanation

The specified identifier is not a member or base class of the class being constructed.

398

ERROR: Member access through protected base class not allowed for '[member-name]'.

Explanation

The specified member cannot be accessed because it has been inherited from a protected base class and the function or initializer using the member is not a friend or member of a class derived from that base.

399

ERROR: Member access through private base class not allowed for '[member-name]'.

Explanation

The specified member cannot be accessed because it has been inherited from a private base class and the function or initializer using the member is not a friend or member of the class that is derived directly from that base.

400

ERROR: Base access through protected base class not allowed.

Explanation

The expression that is attempting to access the base class is not in a function or initializer that has access to it. Because the base class is protected, only functions of the following types have access to the base class: Initializers for members of a class have the same access privileges as functions of that class.

401

ERROR: Base access through private base class not allowed.

Explanation

The expression that is attempting to access the base class is not in a function or initializer that has access to it. Because the base class is private, only functions that are members or friends of the class that declared the base class have access to the base class. Initializers for members of a class have the same access privileges as functions of that class.

402

ERROR: Cannot access protected member '[member-name]'.

Explanation

The expression that is attempting to access the member member-name is not in a function or initializer that has access to it. Because member-name is protected, only functions of the following types have access to member-name: Initializers for members of a class have the same access privileges as functions of that class.

403

ERROR: Cannot access private member '[member-name]'.

Explanation

The expression that is attempting to access the member member-name is not in a function or initializer that has access to it. Because member-name is private, only functions that are members or friends of the class that declared member-name have access to member-name. Initializers for members of a class have the same access privileges as functions of that class.

404

ERROR: Virtual function '[function-name]' declared in virtual base '[class-name]' must be overridden.

Explanation

The virtual function is declared in a virtual base class. It is also overridden in at least two classes derived from the base class and inherited by the class that caused this message. The specified virtual function must be declared in the class that caused this message.

406

ERROR: Parameter of type 'void'.

Explanation

Parameters to functions cannot be declared to be of type void.

407

ERROR: Default argument expression missing.

Explanation

If a formal parameter has a default argument value, then all the parameters after this one must also have default argument values.

408

ERROR: Multiple declarations of function specifying default arguments.

Explanation

The default argument for a formal parameter can be given in only one function declaration.

409

ERROR: Arrays cannot contain elements of type 'void'.

Explanation

Array elements must be of some type other than void.

410

ERROR: Arrays cannot contain bitfields.

Explanation

Array elements must be of some type other than bitfield.

411

ERROR: Arrays cannot contain functions.

Explanation

You can define an array of function pointers, but not an array of functions.

412

ERROR: Functions cannot return functions.

Explanation

A function can return a function pointer, but it cannot return a function.

413

ERROR: Functions cannot return arrays.

Explanation

A function can return a pointer, but it cannot return an array.

414

ERROR: Functions cannot return bitfields.

Explanation

Bitfields cannot be returned by functions.

415

ERROR: Functions cannot return undefined classes.

Explanation

If a function is intended to return a class, that class must first be defined.

416

ERROR: Pointers cannot point to references.

Explanation

References are not addressable and so cannot be referenced by pointers.

417

ERROR: Pointers cannot point to bitfields.

Explanation

Bitfields are not addressable and so cannot be referenced by pointers.

418

ERROR: References cannot refer to references.

Explanation

A reference whose value is a reference is not permitted.

419

ERROR: References cannot refer to bitfields.

Explanation

A reference cannot refer to a bitfield.

420

ERROR: References cannot refer to objects of type 'void'.

Explanation

There are no void objects, so there cannot be a reference to one.

421

ERROR: Member pointers cannot point to bitfields.

Explanation

Bitfields cannot be referenced by member-pointers.

422

ERROR: Member pointers cannot point to references.

Explanation

A reference cannot be referred to by a member-pointer.

423

ERROR: Member pointers cannot point to objects of type 'void'.

Explanation

Because there are no void objects, a pointer cannot point to one.

424

ERROR: Bitfields must be of integral type.

Explanation

Bitfields cannot be of floating-point type.

425

ERROR: Overloaded functions with indistinguishable arguments.

Explanation

Two functions have the same name and the same parameter list. Either delete one of the functions, or change its definition.

426

WARNING: K&R C style function definition.

Explanation

A Kernighan and Ritchie (K&R) C style function definition has been encountered. C++ requires function definitions to be of prototypical form, but K&R style function definitions are permitted as an extension. This message is only to warn you about the use of this extension. If you do not want to see this warning, use the suppress translator option to turn it off.

427

ERROR: K&R C style functions cannot return classes with constructors or destructors.

Explanation

If a function is to return a class with a constructor and destructor, it must be defined by means of a prototypical function definition, as opposed to using a Kernighan and Ritchie (K&R) C style function definition.

428

ERROR: Conversion function must be a member function.

Explanation

A conversion function for a class must be defined as a member function.

429

ERROR: Destructor function must be a member function.

Explanation

The destructor for a class must be defined as a member function.

430

ERROR: Conversion function '[function-name]' not correctly declared.

Explanation

A return type was specified for a conversion function, or formal parameters were given for a conversion function. Declarations of conversion functions do not specify the return type in the usual way. The return type is part of the name of the function. Also, conversion functions cannot take arguments.

431

ERROR: Destructor function '[destructor]' not correctly declared.

Explanation

A destructor has been declared to be something other than a function, or a return type was specified for a destructor. Destructors must be functions and declarations of destructors cannot specify a return type (not even void).

432

ERROR: Copy constructor for a class may not take an argument whose type is that class.

Explanation

Copy constructors cannot take an argument whose type is the class of which the copy constructor is a member. Typically, you can copy objects of class ABC by declaring a copy constructor of the form ABC::ABC(const ABC&).

433

ERROR: Operator function '[function-name]' not correctly declared.

Explanation

An operator function must be either a member function or have at least one parameter of type class.

434

ERROR: Invalid linkage specifier.

Explanation

The extern keyword must be followed by a string literal containing either "C" or "C++". This error may also be caused by an extra or misspelled token after an extern keyword. "C" and "C++" must be specified in uppercase.

435

ERROR: Linkage differs from prior declaration.

Explanation

The linkage specified is not the same as that specified in a prior declaration of the function.

436

ERROR: Unknown linkage convention.

Explanation

SAS/C C++ implements only the "C" and "C++" linkage conventions. Linkage to other languages must be specified using the SAS/C language keywords. For more information on using other languages in combination with C, see the SAS/C Compiler Interlanguage Communication Feature User's Guide.

437

ERROR: Missing class name.

Explanation

A class name was expected but not found. This may be caused by a misplaced comma.

438

ERROR: Repeated base class.

Explanation

A base class can be mentioned only once in the base-list.

439

ERROR: Objects of abstract classes '[object-name]' cannot be declared.

Explanation

Classes that have pure virtual functions (abstract classes) can be used only as base classes; they cannot be used to declare variables or members of other classes. It is permissible to declare pointers to abstract classes.

440

ERROR: Object of type 'void'.

Explanation

Only a function or a pointer can be declared to be of type void.

441

ERROR: Static members '[member-name]' of a local class may not be initialized.

Explanation

This is one of the limitations of local classes. All static data members of local classes are automatically initialized to zero.

442

ERROR: Cannot use undefined enum '[identifier]'.

Explanation

Enumerations must be defined before they can be used.

443

ERROR: Enum constants '[identifier]' must be initialized with integral values.

Explanation

The values of an enumeration must be integral values (rather than, for example, floating-point values).

444

ERROR: A class cannot be a member of itself.

Explanation

No member of a class can be of the same type as that class (although a class can have as a member a pointer or reference to that type of class).

445

ERROR: Cannot declare members of an undefined class.

Explanation

A class must be defined before any of its members can be declared.

446

ERROR: Cannot declare arrays of an undefined class.

Explanation

If an array of instances of a given class is to be declared, the class must first be defined.

447

ERROR: Cannot declare variables of an undefined class.

Explanation

Classes must be defined before objects of that class can be declared.

448

ERROR: Cannot initialize data members in member declaration.

Explanation

Data members cannot be initialized within the class definition. Non-static data members must be initialized in the mem-initializer of each constructor function. Static data members must be initialized outside the class.

449

ERROR: Member function of a local class must be defined within that class: [class-name].

Explanation

A member function of a local class must be defined within that class and not merely declared within the class.

450

ERROR: Member '[member-name]' declared 'void'.

Explanation

A member cannot be of type void.

451

ERROR: 'friend' used on non-function.

Explanation

The friend keyword has meaning only in function declarations inside a class.

452

ERROR: 'friend' can only be used inside a class.

Explanation

The friend keyword has meaning only in function declarations inside a class.

453

ERROR: Invalid syntax for access declaration.

Explanation

A member declaration contained inconsistent information such as: Either add the friend keyword, remove the type information, or remove the class name and scope operator, depending upon which type of declaration you intended.

454

ERROR: Invalid access adjustment: '[member-name]'.

Explanation

Access to a base class member cannot be adjusted in a derived class that defines a member of the same name.

455

ERROR: Access cannot be changed, but only reinstated.

Explanation

Access declarations must declare the inherited member to have the same access as the member in the class from which it is inherited.

456

ERROR: Previously declared as a member in this class.

Explanation

An access declaration cannot specify a name defined in the derived class.

457

ERROR: '[class::member]' is not a member of a base class.

Explanation

The specified member is not a member of any base class.

458

ERROR: Access declaration names class that is not a base of this class.

Explanation

You have tried to control access to a member of a base class by using an access declaration, but the base class name you have used is not truly a base class of the derived class. You may have misspelled the base class name.

460

ERROR: Constructor function '[constructor]' not correctly declared.

Explanation

An incorrectly declared constructor has been found. Perhaps you have specified a return type for a constructor, or the name used in the declaration of the constructor is not the same as the name of the class. Declarations of constructors cannot specify a return type (not even void), and the name of the constructor must be the same as the class name.

461

ERROR: Destructor function '[destructor]' not correctly declared.

Explanation

An incorrectly declared destructor has been found. Perhaps you have declared it to be something other than a function or specified a return type for the destructor. Destructors must be functions, and declarations of destructors cannot specify a return type (not even void). The name of the destructor must be a tilde (~) followed by the class name.

462

ERROR: Operator function '[function-name]' not correctly declared.

Explanation

An incorrectly declared operator function has been found. Perhaps you declared it with the wrong number of arguments. Unary operators take only one argument and binary operators take two arguments. Also, member functions have an implicit this argument, which counts against this limit. So, for example, a unary operator declared as a member function has no explicit formal parameters.

463

ERROR: Static functions '[function-name]' cannot be virtual.

Explanation

static functions cannot be virtual. Remove the virtual keyword from the declaration of the static function.

464

ERROR: Constructors '[constructor]' cannot be virtual.

Explanation

Constructor functions cannot be virtual. Remove the virtual keyword from the declaration of the constructor function.

465

ERROR: Static functions '[function-name]' cannot be used to override virtual functions.

Explanation

A static member function was declared to have the same name and argument types as a virtual function inherited from a base class. Use a different name for the static function.

467

ERROR: Linkage specification cannot be used in a member declaration '[member-name]'.

Explanation

Linkage declarations can be used only in file-scope declarations of non-members.

468

ERROR: Cannot define classes or enums in return types or parameter lists.

Explanation

Classes and enumerations cannot be defined in parameter lists (prototypes) or in return type declarations.

469

ERROR: Invalid parameter name '[parameter]'.

Explanation

Parameter names cannot be operator function names, operator conversion names, or destructor names.

472

ERROR: Formal '[argument]' is not listed in function declaration.

Explanation

All arguments to a function must be listed in the parameter list of the function.

473

ERROR: Initialized local extern '[variable]'.

Explanation

External variables declared inside a function cannot be initialized in the function. Instead, they must be initialized by another declaration outside the function.

474

ERROR: A typedef name ('[name]') cannot be initialized.

Explanation

Declarations of typedef names cannot contain initializers.

475

ERROR: Class with constructors must have an initializer.

Explanation

Variables declared to be of classes that have constructors must be initialized.

476

ERROR: Cannot define classes or enums in type names.

Explanation

Classes and enumerations cannot be defined in cast operators, new operators, sizeof expressions, or offsetof expressions.

477

ERROR: Not a function.

Explanation

A file-scope declaration followed by a mem-initializer or a function body must declare a function.

478

ERROR: A mem-initializer may be used only within constructor functions.

Explanation

This message occurs when a colon follows a function declarator, but the function is not a constructor.

479

ERROR: Base or member '[identifier]' re-initialized.

Explanation

The same base class or member was initialized by two mem-initializers in the same constructor function. For example, the following code generates this message because the a(10) part appears twice:
X::X() : a(10), a(10)

{ . . . }

480

ERROR: Old style base initializer cannot be used on class with no bases.

Explanation

An old style base initializer is a mem-initializer with no specified name. They can be used only for classes with a single base class. For example, if X has no base classes, the following code tries to initialize a non-existent base and generates this message:
X:: X() : (10)

{ . . . }
To correct the error, delete the (10) part.

481

ERROR: Old style base initializer cannot be used on class with multiple base classes.

Explanation

An old style base initializer is a mem-initializer with no specified name. They can be used only for classes with a single base class. For example, if X has more than one base, the following code is ambiguous and generates this message:
X::X() : (10)

{ . . . }
To correct the error, insert the name of a specific base class before the (10).

482

WARNING: Statement is unreachable.

Explanation

The statement flagged will never be executed. You may want to check your program logic.

483

ERROR: 'case' label must be within a switch statement.

Explanation

A case label is not allowed outside of a switch statement.

484

ERROR: `default' label must be within a switch statement.

Explanation

The default label is not allowed outside of a switch statement.

485

ERROR: 'continue' must be within a loop ('do', 'for', or 'while') statement.

Explanation

The continue statement is not allowed outside of a loop statement.

486

ERROR: 'break' must be within a switch or loop ('do', 'for', or 'while') statement.

Explanation

The break statement is valid only within switch or loop statements.

487

ERROR: Missing return value.

Explanation

The return value of the function was not specified.

489

ERROR: Return value given for constructor, destructor, or void function.

Explanation

A return value is not allowed in a constructor, destructor, or void function.

490

ERROR: Missing function name in function declaration.

Explanation

A function name was expected but not found. You may have misspelled the name of a constructor function.

491

ERROR: Illegal formal declaration list in prototype function definition.

Explanation

A function definition included both a prototype and one or more K&R C style argument declarations. These two styles cannot be mixed in a single definition.

492

ERROR: Formal '[argument]' must be declared in function header identifier list.

Explanation

In K&R C style function definitions, formals declared in the formal declaration list must have already been specified in the identifier list of the function.

493

ERROR: Expression in array declarator must be constant expressions.

Explanation

Array declarations that specify a size must specify it as a non-negative integral constant expression.

494

ERROR: Expression in array declarator must be integral.

Explanation

Array declarations that specify a size must specify it as a non-negative integral constant expression.

495

ERROR: Expression in array declarator must be positive.

Explanation

Array declarations that specify a size must specify it as a non-negative integral constant expression.

496

ERROR: Map directive does not match prior directive.

Explanation

The map directive specified is not the same as that specified in a prior declaration of the symbol.

498

ERROR: Invalid bitfield size.

Explanation

Bitfield sizes must be a non-negative constant expression less than or equal to the size of the specified allocation unit.

499

ERROR: Cannot use undefined class '[class-name]' as base class.

Explanation

The specified class must be defined before it can be used as a base class for another class.

500

ERROR: Missing declaration-specifier.

Explanation

Declaration specifiers are required in all non-function declarations. They are also required in function declarations in parameter lists.

501

ERROR: Illegal use of '[item]' in local member function.

Explanation

Local member functions can use type names, static variables, extern variables and functions, and enumeration constants only from the enclosing scope.

502

ERROR: A class cannot be derived from a union ['union-name'].

Explanation

A class cannot be derived from a union.

503

ERROR: A union ['union-name'] cannot be derived from another class.

Explanation

A union cannot be derived from another class.

504

ERROR: Constant expression contains a division by zero (0).

Explanation

Constant expressions cannot contain division by zero.

506

ERROR: Cannot take the size of a function.

Explanation

Functions have no size, although function pointers do.

507

ERROR: Cannot take the size of a bitfield.

Explanation

Bitfield sizes are not expressible in bytes.

508

ERROR: Cannot take the size of void.

Explanation

Because there are no void objects, you cannot take the size of one.

509

ERROR: Cannot take the size of array with unspecified length.

Explanation

The array was declared without giving its length, so its size cannot be determined.

510

WARNING: Cannot jump into a block to a label after a declaration having an initializer.

Explanation

You can't use a goto statement to jump into a block if the destination label occurs after a declaration has been initialized. Should such a jump occur, the object in question would not be initialized but could be referenced in subsequent code.

511

ERROR: Overloaded member functions '[function-name]' may not be both static and non-static.

Explanation

All member functions of the same name must be either static or non-static.

512

ERROR: Function hides a virtual function from base class.

Explanation

Because the function hides a virtual function, the virtual function is not called.

513

ERROR: Overriding virtual function '[function-name]' has different return type.

Explanation

An overriding virtual function cannot change the return type.

514

ERROR: Arrays cannot contain references.

Explanation

Arrays of references are not allowed.

515

ERROR: Previous declaration of function had different return type.

Explanation

An earlier declaration of the function specified a different return type.

516

ERROR: Cannot have two extern "C" functions with same name '[name]'.

Explanation

In a program, only one of a set of overloaded functions of a given name can be declared extern "C".

517

ERROR: Previous declaration differed in the use of __builtin.

Explanation

All declarations of a function must be consistent in the use of the __builtin keyword. All must have it, or none must have it.

518

ERROR: [object-type] '[expression]' cannot be used in default argument expressions.

Explanation

Non-static members, formal parameters, and automatic variables cannot be used in default argument expressions.

521

ERROR: Ambiguous use of keyword.

Explanation

An ILC language keyword was used in a place where it could apply to two different functions. Follow these rules when placing ILC language keywords:

522

ERROR: Keyword can only be used on functions.

Explanation

A keyword that can be used only in function declarations has been used in a declaration of some other type. For example, virtual and inline can be used only in function declarations.

523

ERROR/WARNING: '[keyword]' cannot be applied to [object-type].

Explanation

It is invalid to apply the keyword in the specified context. For example, it is meaningless to apply a storage class keyword such as auto to the definition of a class (although auto can be applied to the definition of an object whose type is that class). Depending upon the combination of keywords in question, this may be treated as a warning or an error.

524

ERROR: Previous declaration was not static.

Explanation

A function was first declared non-static and later declared static.

525

ERROR: Function declared 'inline' after first use.

Explanation

A function was used prior to its declaration as an inline function.

526

ERROR: Prototypes can only be specified for C, C++, and __asm functions.

Explanation

Prototypes for functions in other languages are not supported.

527

ERROR: Only C, C++, and __asm functions can be overloaded.

Explanation

Functions written in other languages cannot be overloaded.

528

ERROR: Member functions must be C++ functions.

Explanation

Only C++ functions (and not functions in C or in other languages) can occur as member functions.

529

ERROR: Keyword can only be used on function pointers.

Explanation

The keywords __local and __remote can be used only on function pointers.

531

ERROR: A declaration must declare something.

Explanation

An empty declaration has been encountered. This message usually is caused by the omission of a variable name in a declaration (leaving only a sequence of keywords or type symbols).

532

ERROR: [function-name] cannot have '[storage-type]' storage class.

Explanation

A member function declared const or volatile cannot also be declared static.

533

WARNING: Extra comma at end of enumeration list.

Explanation

An enumeration list has an extraneous comma after its last member.

534

WARNING: Enum value: [value] is used for both '[enum-1]' and '[enum-2]'.

Explanation

An enumeration value has been repeated. This warning is given if two enum constants in the same enumeration type have the same value. This may be what you intended; the warning is given in case it is not intended.

535

ERROR: Cannot overload 'main' or '_dynamn'.

Explanation

Neither main nor _dynamn can be overloaded.

536

ERROR: Cannot call or take the address of 'main'.

Explanation

The function main cannot be called, nor can its address be taken.

537

ERROR: 'main' cannot be 'storage-type'.

Explanation

The function 'main' cannot be declared static or inline.

538

ERROR: Anonymous classes cannot have constructors or destructors.

Explanation

An anonymous (unnamed) class cannot have a constructor or a destructor.

539

ERROR: Destructor names '[destructor]' must be the same as their class names '[class]'.

Explanation

The tilde (~) can be used only to declare a destructor if that destructor has the same name as the class for which it is a destructor.

540

ERROR: Expression in array declarator must not be negative.

Explanation

In C++, an array must be declared to be of a positive size. As an extension, SAS/C C++ allows the declaration of zero-length arrays.

541

ERROR: Cannot allocate array of class '[class-name]' with no default constructor.

Explanation

In order to allocate an array of a class with the new operator, the class must have a default constructor.

542

ERROR: Invalid constructor given for member '[member-name]'.

Explanation

An invalid constructor has been encountered. This happens in two circumstances:

543

ERROR: '[operand-1]' and '[operand-2]' are not compatible types for conditional operator.

Explanation

The two operands are not of compatible type for use with the conditional operator.

544

ERROR: [type-1] [operator] [type-2]: Invalid type for binary operator.

Explanation

One of the types displayed is inappropriate for the operator in question or is incompatible with the other type in this context.

545

ERROR: '[operand]' is of invalid type for postfix operator '[operator]'.

Explanation

The postfix operator (++ or --) cannot be applied to an object of the given type.

546

ERROR/WARNING: '[operator]' is invalid for operand type '[operand]'.

Explanation

The operator cannot be applied to an operand of this type. Depending upon the operator/operand pair in question, this may be either a warning or an error.

547

ERROR: '[object]' is of invalid type for call operator.

Explanation

The call operator (()) cannot be applied to an object of the given type.

548

ERROR: Invalid pointer conversion from '[type-1]' to '[type-2'].

Explanation

It is not possible to convert a pointer to an object of the given type.

549

WARNING: Non-const and/or non-volatile member function called with const and/or volatile object.

Explanation

It is an error to call a non-const member function for a const object or a non-volatile member function for a -volatile object, but because many other compilers fail to diagnose this error, SAS/C C++ treats it as a warning. Ignoring this warning allows non-const functions to change data declared as const.

550

WARNING: Non-constant reference ([reference]) bound to a non-lvalue.

Explanation

The reference in question is to a non-const but has been initialized with something that is not an lvalue.

551

ERROR: Cannot take size of pointer to overloaded function '[function-name]'.

Explanation

Because an overloaded function name does not uniquely determine the function designated, a pointer to such a function likewise is not uniquely determined and consequently its size may be indeterminate as well. Accordingly, sizeof cannot be applied to such a pointer.

552

WARNING: Address of temporary taken by casting to reference, ([reference]).

Explanation

Care should be taken with the result of such a cast because the resulting reference may outlive the temporary it refers to, resulting in a dangling reference.

553

ERROR: Error writing to output file: [filename].

Explanation

An error has been encountered in writing to the output file. This could be caused by a variety of environmental factors (such as a lack of disk space). stderr may contain library messages with additional information about the error.

554

ERROR: Inline member function does not end.

Explanation

The end of the input file has been encountered before the closing brace (}) was seen for a member function.

555

ERROR: Static function '[function-name]' was not defined.

Explanation

The specified function was declared static but has not been defined in this source file.

556

ERROR: Global anonymous unions must be static.

Explanation

An anonymous union declared at file scope must be declared as static.

557

ERROR: Anonymous unions may not have function members.

Explanation

You cannot define an anonymous union that contains function members. If you want function members, use another construct, such as a plain union, struct, or class.

558

ERROR: Anonymous unions may not have private or protected members.

Explanation

You cannot define an anonymous union that contains private or protected members. If you want private or protected members, use another construct, such as a plain union, struct, or class.

559

ERROR: '[identifier]' redeclared in anonymous union.

Explanation

The specified identifier was previously declared to have some other type.

560

ERROR: An anonymous union cannot be declared as a static member.

Explanation

An anonymous union has no name for linkage to the definition.

561

ERROR: Cannot load special character table '[table-name]'.

Explanation

The character set translation table could not be found, was corrupted, or was installed incorrectly.

562

ERROR: Conflicting declaration of name '[identifier]' reserved for [purpose].

Explanation

You have inadvertently used a name that the translator or compiler reserves for its own uses. Choose another name.

564

ERROR: Cannot initialize a function '[function-name]'.

Explanation

You cannot initialize a function. You can initialize only variables.

565

ERROR: Static members [member-name] cannot be initialized by a mem-initializer.

Explanation

Static members should be initialized by the definition of the static member outside the class. For example, this message is issued if you use the following code and a is a static member:
X::X() : a(10)

{ . . . }

566

ERROR: Enum constants [identifier] cannot be initialized by a mem-initializer.

Explanation

Enum constants should be initialized inside the enum declaration, as they are in C. For example, this message is issued if a is an enumeration constant:
X::X() : a(10)

{ . . . }

567

ERROR: Types must match in a destructor expression: (<object-type>)<destructor-type>

Explanation

When calling a dummy destructor for a builtin type, it is required that the type specified in the destructor name match the type (dereferenced for -> ) of the left operand of the . or -> expression. This message is also output for class destructors when the destructor is specified as an unqualified name (i.e. "object.type_name") and the specified type does not match the object type.

568

ERROR: Cannot create a new value of a void.

Explanation

The new operator cannot be applied to void. Because void is not an object type, a pointer to it could not be returned by operator new.

569

ERROR: Loop in -> operators.

Explanation

The pointed-to expression uses a user-defined operator -> that either returns the class that contains the operator or returns a class that contains another operator -> which in turn returns the class containing the original operator ->. The loop might be more complicated, but in any event the sequence leads back to the original operator ->.

570

ERROR: A linkage-specification may occur only in file scope.

Explanation

Linkage-specifications are not permitted in block scopes, class scopes, or function scopes.

571

ERROR: Cannot define a type in return or argument types.

Explanation

A type (for example a struct tag) cannot be defined in an argument list or in the specification of the return type.

572

ERROR: [object] may not have the same name as its class.

Explanation

A static data member, enumeration, member of an anonymous union, or a nested type cannot have the same name as its class.

573

ERROR: An overloaded operator '[operator]' cannot have default arguments.

Explanation

It is illegal to declare overloaded operators with default arguments. For example, int operator + (int=3,int=4) is not a valid declaration.

574

ERROR: Invalid use of abstract class: [class-name].

Explanation

An abstract class cannot be used as an argument type, a function return type, or the type of an explicit conversion.

575

ERROR: An object of a class with an [object-type] may not be a member of a union.

Explanation

An object of a class with constructors, destructors, or user-defined assignment operators cannot be a member of a union. For more information, refer to CPL2 r.9.5.

576

ERROR: Error declaring 'new': [reason].

Explanation

operator new must have a return type of void*. Its first argument is required and must be of type size_t. For more information, refer to CPL2 r.12.5.

577

ERROR: Error declaring 'delete': [reason].

Explanation

The delete function must have return type void. Its first argument must be of type void* and if there is a second argument, it must be of type size_t. No more than two arguments are permitted. For more information, refer to CPL2 r.12.5.

578

ERROR: Initializer-clause cannot be used for class having an [object-type].

Explanation

A class having a constructor, a private or protected member, a base class, or a virtual function is not an aggregate and cannot be initialized by means of an initializer-clause (for example, ={10,2,10.2}). For more information, refer to CPL2 r.8.4.1.

579

ERROR: Conversion to a virtual base class '[class-name]' from a derived class is not allowed for member pointers.

Explanation

Virtual base classes cannot be converted, explicitly or implicitly, from derived classes.

580

ERROR: Cannot return [attempted-return-type] from function returning [declared-return-type].

Explanation

The return value is of a type that cannot be converted to a type required by the function's return type.

581

ERROR: Function '[function-name]' has an initializer.

Explanation

Functions cannot be initialized, although function pointers can be initialized.

582

ERROR: Character array [array-name] too short for string of length [string-length].

Explanation

A character array cannot be initialized by a string that has more characters than the array has elements.

583

ERROR: Too many initializers for [array-name]: found [num] initializers.

Explanation

No array can be initialized with more initializers than the array has elements.

584

ERROR: Too many initializers for [class-name].

Explanation

No class can be initialized with more initializers than the array has members.

585

ERROR: Left operand of '[operator]' must be [type].

Explanation

The left operand of the dot operator (.) must be a class object.

586

ERROR: Type '[type]' is invalid for the left operand of '[operator]'.

Explanation

The left operand of the arrow operator (->) must resolve to a class pointer.

587

ERROR: Case label value must be a constant expression.

Explanation

You have used a non-constant expression as a case label.

588

ERROR: Duplicate case label value.

Explanation

The same case label occurs more than once within a switch statement.

589

ERROR: More than one default.

Explanation

There is more than one default label in a single switch statement.

590

ERROR: [symbol-name] is not an enum.

Explanation

The specified symbol was used after the enum keyword, but is not an enumeration.

591

ERROR: [symbol-name] is not a class, struct, or union.

Explanation

The specified symbol was used after a class, struct, or union keyword, but is not a class, struct, or union.

592

WARNING: Wide and narrow character strings concatenated, using [width].

Explanation

Wide characters strings are of the form L"abc"; narrow characters strings are the usual "abc". These two types of strings should not be concatenated together. For example, neither of the following statements are valid:
"abc" L"def" 

L"abc" "def" 
If the first string in the concatenation is wide, the translator treats the result as a wide string. Similarly, if the first string is narrow, the translator treats the result as narrow.

593

WARNING: Missing return statement.

Explanation

A return statement is missing at the end of the outer block of a function and a return value is required.

594

WARNING: Zero-length array used.

Explanation

Zero-length arrays are allowed in classes (types class, struct, and union) as an extension of standard C and C++. This message is only to warn you about the use of this extension. If you do not want to see this warning, use the suppress translator option to turn it off.

595

ERROR: Floating point value out of range.

Explanation

The value of a floating-point constant, or the result of an operation on floating point constants is either too large or too small to be represented. Frequently, this is caused by a multiplication or division of two floating-point constants.

596

ERROR/WARNING: [data-type-1] initialized with [data-type-2].

Explanation

A shorter data type has been initialized with a longer data type. For example, an int has been used to initialize a char. If the initializer is a constant whose value is too large to be represented by the shorter type, this is an error. If the initializer is a variable, this is a warning. (If the value of a constant initialization can be represented by the shorter type, neither a warning nor an error is issued.)

597

ERROR/WARNING: [data-type-1] assigned to [data-type-2].

Explanation

A longer data type has been assigned to a shorter data type. For example, a long has been assigned to a short. If the value assigned is a constant which is too large to be represented by the shorter type, this is an error. If the assigned type is a variable, this is a warning. (If the value of an assigned constant can be represented by the shorter type, neither a warning nor an error is issued.)

598

ERROR/WARNING: [sign-type-1 data-type-1] assigned to [sign-type-2 data-type-2].

Explanation

A signed data type has been assigned to an unsigned data type of the same size (for example, a long has been assigned to an unsigned long), or conversely, an unsigned data type has been assigned to a signed data type of the same size (for example, an unsigned int has been assigned to an int). If the assigned value is a constant that cannot be represented correctly by the type to which it is assigned, an error results. Otherwise, the message is a warning.

599

ERROR: A function definition [name] requires an explicit parameter list.

Explanation

The named function was defined with a function typedef name. This is erroneous because the parameter list is not explicitly stated in the function definition. For example, the following code would produce this message:
         typedef int F(int);
         F foo
             {
             return 10;              }

600

WARNING: Implicit conversion of member function [name] to a member pointer.

Explanation

This warning indicates that a non-standard feature was specified. The address-of (&) operator is implicitly applied by the compiler to the named member function to create a member pointer to function. Other C++ systems may require the address-of operator.

601

WARNING: Symbol [name] was not used.

Explanation

This warning is given for symbols local to a function that are never used and sometimes indicates a mistake in the function.

602

WARNING: Variable [name] used before being initialized.

Explanation

An uninitialized variable was used before it was assigned.

603

WARNING: Symbol [symbol] was initialized but never referenced.

Explanation

This warning is given for symbols local to a function that are defined but that do not have their value used. This warning sometimes indicates a mistake in the function.

604

ERROR: Return type of 'operator [new | delete]' cannot be changed after it has been used.

Explanation

C++ pre-declares library versions of the default operator new and operator delete functions. A program may declare its own versions of these operator functions with differing return types from those in the library, but this must be done before any use of these operator functions.

Action

This error can be fixed by moving the declarations of new and delete before using their operators.

605

ERROR: [name] must be a function, not a [type].

Explanation

An overloaded operator must be a function, not a type.

606

ERROR: [data-type] may not use ellipsis ('...').

Explanation

The ellipsis punctuator ('...') may not be used in an overloaded operator except with operator new.

607

ERROR: [name] must return a [type1] not a [type2].

Explanation

The named function must return a [type1] not a [type2].

608

ERROR:'operator new's first argument must be a 'size_t'.

Explanation

Operator new must be a function returning a void pointer. Its first argument must be a size_t.

609

ERROR: 'operator delete's first and only argument must be a 'void *'.

Explanation

Operator delete must be a function returning void. Its first and only argument must be a void pointer.

610

ERROR: Previous declaration of [name] was [attribute1], this declaration is [attribute2].

Explanation

An attribute of a symbol was declared differently in a previous declaration. The message specifies the symbol and attribute.

Note: For some attributes, C++ will apply a default if the attribute is not explicitly specified in the declaration. A declaration with a specific keyword may conflict with a previous declaration with no keyword, depending on the current defaults. Which defaults are applied by C++ depend upon the specific attribute and the user supplied options. For example, if a previous declaration specified __rent, the current declaration for the same symbol cannot specify __norent. Declarations must be consistent.

611

ERROR: Previous declaration of [name] differed in the use of [attribute].

Explanation

An attribute of a symbol was declared differently in a previous declaration. Either the previous declaration used a keyword that is not present in this declaration, or did not use a keyword that is present in this declaration.

Note that for some attributes, C++ will apply a default if the attribute was not explicitly specified in the declaration. So a declaration with a specific keyword may conflict with a previous declaration with no keyword depending on the current defaults. Which defaults are applied by C++ depend upon the specific attribute and the user supplied options. The declarations should be made consistent.

617

ERROR: Default argument(s) of function used before they are defined.

Explanation

The default arguments of one function cannot use the default arguments of a function declared later in the class.

618

ERROR: Invalid use of K&R C style declaration for [name].

Explanation

Only global functions may use the K&R C style function syntax. Member functions must use the C++ prototype syntax. This error sometimes occurs because of a syntax error in the formal argument list.

619

ERROR: Bitfields cannot be static members.

Explanation

Bitfields cannot be static members.

Action

Either make the bitfield non-static, change the bitfields to an integral type, or nest the bitfield in another struct, and make the struct a static member.

Reference

Stroustrup, Bjarne (1991), The C++ Programming Language, Reading, MA: Addison-Wesley Publishing Company.

620

ERROR: Missing template argument list for '[template-name]'.

Explanation

The specified template name was used without a template argument list in a context where the argument list is required. For class templates, the argument list is required except within declarations of the template class itself.

621

ERROR: Invalid template argument.

Explanation

A template argument must be a constant expression (not floating point), the address of an object or function with external linkage, or the name of an object or function with external linkage.

622

ERROR: Not enough arguments for template.

Explanation

The template argument list had too few arguments specified.

623

ERROR: Too many arguments for template.

Explanation

The template argument list had too many arguments specified.

624

ERROR: Cannot instantiate incomplete template class '[template-class]'.

Explanation

A use of a template class requires its definition, but the definition of the template has not been completed.

625

ERROR: Recursive template instantiation of '[template-class]'.

Explanation

During instantiation of a template class specialization, a use of the class was encountered that required it to already be instantiated.

626

ERROR: Template actual parameters cannot depend on unnamed or local types.

Explanation

A template argument contains a user defined type that is either unnamed, declared inside a function, or declared inside an unnamed scope.

627

ERROR: Template instantiation failed for '[template]'.

Explanation

Instantiation of the template specialization could not be completed. This could be due to a syntax error diagnosed in preceding messages.

628

WARNING: Template function not deducible.

Explanation

Not all template argument types and values can be determined from the function parameter types. References to this template function must explicitly specify the non-deducible template arguments.

630

ERROR: Template declaration has a nested class definition.

Explanation

A template declaration defines a class, but it also includes a declarator. The class definition should be declared separately from the item referred to by the template declarator.
template <class T>
   class C { . . . }
* func( T* ); // Error

631

ERROR: Scope for '[name]' does not match a class template.

Explanation

The scope for the name being declared in a template must match a class template. For example:
template <class T, class U> class C {
   class Nested { ... };
   ...
};

template <class X, class Y> int C<X, Y>::i = 1; // OK
template <class X, class Y> int C<X, Y>::Nested::i = 1; // OK
template <class X, class Y> int C<Y, X>::j = 0; // Error
template <class X, class Y> int C<Y, int>::k = 7; // Error
In other words, the template parameters in effect must match the parameters from the template class declaration and the argument list for the template scope must use the template parameters in the original order.

632

ERROR: Template class member declaration must define the member.

Explanation

Template declarations of template class member functions must define the member, except for friend declarations. The same restriction exists for non-template class members.

633

WARNING: Statement has no effect.

Explanation

The evaluation of the specified statement has no side-effects.

634

ERROR: Unrecognized template declaration.

Explanation

A template declaration must declare or define a function, class, or static data member.

635

ERROR: Template argument list does not match formals.

Explanation

A template argument does not match the corresponding template formal. This could occur if, say, a type argument was specified for a data formal, or a data argument was specified for a type formal.

636

ERROR: Multiple definitions for '[symbol]'.

Explanation

This indicates that specializations of multiple template member definitions match the given member function or data item.

637

ERROR: Template actual '[object]' does not have external linkage.

Explanation

The object or function denoted by a template argument expression must be declared so that it can be referred to by name in other translation units.

638

ERROR: Ambiguous template declarations for '[function-signature]'.

Explanation

This indicates that two or more distinct template declarations correspond to the given function signature. It may be possible to disambiguate the template by explicitly specifying template arguments.

639

ERROR: Type members ([name]) cannot be initialized by a mem-initializer.

Explanation

A mem-initializer specified the name of a type member (i.e. a class, enum, or typedef name) whose type is not a base class of the class being constructed.

640

ERROR: Invalid scoped declaration in member list.

Explanation

The only member declarations that allow scoped name declarators are access and friend declarations.

641

ERROR: Illegal bitfield declaration.

Explanation

Bitfields may only be declared for non-static class members. In particular, typedef may not be used with a bitfield declaration.

642

ERROR: Templates may not be declared in local scopes.

Explanation

Templates must be declared outside any function.

643

ERROR: Invalid explicit template specialization.

Explanation

An explicit template specialization declaration (which begins with template <>) must refer to a specialization of a previously declared template function, template class, or static member of a template class.

644

ERROR: Template function was explicitly specialized after its first use.

Explanation

An explicit template specialization refers to a function that has been previously used. The explicit specialization should be moved before the first use.

645

WARNING: Old-style template specialization.

Explanation

The draft C++ standard requires explicit specializations of template functions, classes, and members to be introduced with template <>.

646

ERROR: Template class was specialized after it was implicitly instantiated.

Explanation

An explicit specialization of an instance of a template class was provided after a use of the specialization that required it to be implicitly generated from its template. The explicit specialization should be moved before the first use of the specialized class that requires the class to be implicitly instantiated.

647

ERROR: Invalid explicit template instantiation.

Explanation

An explicit template instantiation declaration (which begins with the keyword template but has no following template formal list) must specify a specialization of a previously declared template function, template class, or static member of a template class.

648

ERROR: No template definition for '[template]'.

Explanation

An explicit template instantiation was requested for a template specialization (of a template function, template class, or template class member) which does not have a template definition.

649

ERROR: Template instantiations are too deeply nested (>[number] levels).

Explanation

Instantiation of template items required too many pending levels of instantiation. The instantiation process may be unbounded. For example:
template <class X> class C { C<X*> c; };

C<int> x;  // requires C<int>, C<int*>, C<int**>, C<int***>, ...

650

ERROR: Template item was both explicitly instantiated and specialized.

Explanation

Explicit instantiation was requested for a template specialization which was already specialized. Either the member was explicitly specialized or the containing class was specialized.

651

ERROR: Explicit instantiation of a compiler generated function.

Explanation

An explicit instantiation may not refer to an compiler created member of a template class (i.e. implicitly declared constuctors, destructors, and assignment operators).

652

ERROR: Static data member of a template was specialized after it was used.

Explanation

The explicit specialization must precede the first use of the static member that requires a definition.

653

WARNING: Keyword '[keyword]' is not legal in function declaration.

Explanation

The keyword was not legal in the declaration. For example, extern.

654

ERROR: Invalid scoped declaration.

Explanation

A scoped declaration was found in a context where it was not expected. A declaration for a scoped name must refer to a previously declared member of the specified scope.

655

ERROR: Unexpected use of template function name.

Explanation

A template function name (like "f<int>") was used in a context where it was unexpected, such as a non-function declaration. Explicit specializations of functions explicitly specifying a template argument list should begin with template <>.

656

ERROR: Unexpected initializer in an explicit template instantiation declaration.

Explanation

Explicit template instantiations should not specify an initializer.

657

ERROR: Elaborated name depends on a template parameter.

Explanation

Elaborated names which contain template parameters are not allowed in template function declarations. For example:
template <class T>
void f( class T* );  // Error

658

ERROR: A template declaration may declare only one item.

Explanation

Multiple template functions or data members may not be declared in the same template declaration. For example:
template <class T>
void f( T* ),
     g( T* );  // Error

659

ERROR: Unnamed class definition in a template declaration.

Explanation

Classes defined in a template declaration must be named. For example:
template <class T>
class { . . . }; // Error

660

ERROR: Template formal parameters cannot [type].

Explanation

Template formal parameters cannot be floating point, be function member pointers, be void, have function type, or have class type. A template data formal parameter has an invalid type.

661

ERROR: Instantiation of '[name]' has type ([type]) but [type] was expected.

Explanation

Instantiation of [name] has [type], but a class type was expected.

A template declaration, when specialized, used a template formal dependent name in a context where a class name was expected, but the specialized type was not a class. For example:

template <class T> void f( int T::* p );

void testit()
{
   f<int>( 0 );  // Error }

662

ERROR: Instantiated name '[name]' does not resolve to [type/scope].

Explanation

Instantiated [name] does not resolve to a [type/scope] name.

A template declaration, when specialized, used a template formal dependent name in a context where a scope or type name was expected, but the specialized type was not a class type. For example:

template <class T>
class C { public: int Z; };

template <class U>
void f( typename C<U>::Z* p );

void testit()
{
   f<int>( 0 ); // Error, C<int>::Z is not a type }

663

ERROR: Incomplete template member initializer. Found unexpected '[token]'.

Explanation

While scanning the syntax for an initializer in a template member declaration, an unexpected token was found. This probably indicates a missing closing parenthesis or brace. To improve error detection, syntactically valid but semantically invalid constructs like embedded class definitions are not allowed inside the initializer.

For example:

template <class T> struct C {
   static int si; };
template <class T>
int C<T>::si = ( 5 ;  // unexpected ';' due to missing ')'
The C++ translator can sometimes be confused by commas in nested template argument lists in the initializer. Enclosing the initializer in parentheses avoids this limitation:
template <class T>
int C<T>::si = ( otherTemplate< T, T>().memFunc() );

664

ERROR: Template function specialization does not correspond to any template declarations.

Explanation

The declaration of a template function specialization does not match any of the function template declarations.

665

WARNING: Missing elaborator on a friend class declaration.

Explanation

The declaration of a class as a friend should use an elaborated name.

667

ERROR: Template member declaration does not match the member '[member-name]'.

Explanation

The template declaration of a template class member, when instantiated, did not match the declaration from the template class.

668

ERROR: Default arguments are not allowed on template redeclaration '[template]'.

Explanation

Function templates must declare all their template default arguments on their first declaration. Out-of-line template definitions of template class member functions may not declare default arguments. Explicit specialization and instantiation declarations may not declare default arguments.

669

WARNING: Dubious type specifier '[qualified-name]'. Use 'typename'

Explanation

While parsing a template declaration, a qualified name whose scope depends on template formals was encountered where a type specifier was expected. The name is assumed to represent a type, however the draft C++ standard requires a typename keyword to prefix the qualified name. This warning could also occur because of missing type specifiers in a declaration.

670

WARNING: Missing return type specifier.

Explanation

The draft C++ standard requires that function declarations (except for constructors, destructors, and type conversion operators) specify a return type. The "implicit int" rule of C is considered obsolescent.

672

ERROR: A condition cannot specify a function or an array.

Explanation

The declarator in a condition that is an initialized declaration cannot declare a function or an array.

673

ERROR: A condition cannot declare a new class or enumeration.

Explanation

The declarator in a condition that is an initialized declaration cannot define a new class or enumeration.

674

ERROR: No such [conversion-specification] conversion; to ( [type] ) from ( [type] ).

Explanation

The requested conversion was not one of the conversions allowed by the specified new-style cast operator. For example, you would get this error if you used static_cast to try to convert a pointer to an integral type.

675

ERROR: Invalid qualifier change; to ( [qualifier] ) from ( [qualifier] ).

Explanation

The requested new-style cast conversion either discarded qualifiers or was not "const-safe". If the qualifier change is desired, use const_cast<> to perform the needed qualifier conversion.

676

ERROR: Cannot apply typeid operator to an undefined class.

Explanation

If the expression or type name operand has class or reference to class type, the class definition must be complete.

677

ERROR: Cannot apply typeid operator to an overloaded function name.

Explanation

The function name must be resolved to a specific function before using it.

678

WARNING: Polymorphic type information may not be available.

Explanation

typeid or dynamic_cast was applied to a polymorphic type, but the rtti translator option was not specified.

679

ERROR: Header <typeinfo> must be included before using typeid.

Explanation

The <typeinfo> header must be included at global scope before the first use of the typeid operator in order to declare the type_info class.

680

ERROR: Dynamic_cast from undefined class pointer not allowed.

Explanation

The class referred to by the source pointer value must be previously defined.

681

ERROR: Polymorphic class object required.

Explanation

When using dynamic_cast to convert to a void pointer type, the source type must be a pointer to a polymorphic class type. (A polymorphic class is one that has virtual function members.) When using dynamic_cast to convert to a class pointer type, the source type must be a pointer to the same class, a pointer to a derived class of the target class, or a pointer to a polymorphic class. When using dynamic_cast to convert to a class reference, the source type must be of the same class, a derived class of the target class, or a polymorphic class.

682

ERROR: Invalid use of type member [member].

Explanation

The name specified as the right operand of a . or -> operator must be a data or function member.

683

WARNING: Implicit template instantiation uses static object [object].

Explanation

During implicit template instantiation, a use of a static data or function item was detected. Such uses refer to different objects in each compilation unit, violating the requirements for automatic template instantiation. The static use should be removed, or the template item should be explicitly specialized.

684

WARNING: Static use forces automatic template instantiation in primary module.

Explanation

This message is output when static object use (diagnosed by message 683) forces an automatically instantiated item to be inserted in the primary output module for the current compilation unit. This is because static items are only available in the single output module that defines them.

685

WARNING: Inline function [function] uses static object [object].

Explanation

This message is output when the definition of a non-static inline function (either with external linkage or contained in an inline function with external linkage) uses a static object. The function cannot be defined in other compilation units without breaking the one definition rule of C++, and it cannot be used in an automatically instantiated template without producing message 684. The function will be treated as a static object for the purposes of messages 683 to 685 if automatic template instantiation is turned on.

686

ERROR: Inline function [function] was used but not defined.

Explanation

The specified function was declared inline and used, but it was never defined in this source file.

687

WARNING: Dangling temporary reference.

Explanation

This message is output when the compiler detects that a reference has been bound to a temporary whose lifetime is shorter than the lifetime of the reference. Such code is likely to be erroneous. Cases in which this warning is produced include the binding of a temporary to a local static reference:
    void example()
    {
       static const int& i = 5;
     // temporary holding the value 5 lives until function
     // return but the reference persists and is not rebound
     // the next time example() is called.     }

688

ERROR: A condition initializer must be an expression.

Explanation

The initializer for a condition declaration must be an expression, not a brace-enclosed list initializer.

689

Ambiguous result for conditional expression.

Explanation

The second and third operands of a conditional expression are not the same type. At least one is a class value. Each of the operands can be converted to match the type of the other operand.

To avoid this problem, use static_cast to be explicit about the intended conversion.

690

Invalid use of non-static member function.

Explanation

An expression that designates a non-static member function can be used in limited contexts. A non-static member function name can be used as one of the following: Other expressions that designate non-static member functions (such as the result of expressions with the following operators:) can be used only as the left operand of a call expression.

This error could indicate a missing call argument list or an incorrectly specified member pointer constant.

691

Ambiguous use of overloaded function name '<function-name>'.

Explanation

The specific function could not be resolved because an overloaded function name was used in a context other than the function expression of a function call. Besides function expressions, overloaded function names are resolved (by using the target type) in only the following contexts: The ambiguity can be resolved by using an explicit cast to select a particular function.

Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.