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++ diagnostic messages have the form

   LSCTmessage-number 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 following descriptions.

LSCT Messages

  101 102 103 104 105 106 107 108 109
110 111 112 113 114 115 116 117 118 119
  121 122 123 124 125 126 127 128 129
130 131 132   134          
 
180 181 182 183 184 185 186 187 188  
190                  
200 201 202     205 206 207 208  
 
                  319
320 321 322 323 324 325 326 327 328 329
330 331 332   334 335 336 337 338 339
340   342 343 344 345 346 347 348 349
350 351 352 353 354 355 356 357 358 359
  361 362 363 364 365 366 367 368 369
370 371 372 373 374 375 376 377 378 379
380   382 383 384 385 386 387 388 389
  391 392 393 394 395 396 397 398 399
400 401 402 403 404   406 407 408 409
410 411 412 413 414 415 416 417 418 419
420 421 422 423 424 425 426 427 428 429
430 431 432 433 434 435 436 437 438 439
440 441 442 443 444 445 446 447 448 449
450 451 452 453 454 455 456 457 458  
460 461 462 463 464 465   467 468 469
    472 473 474 475 476 477 478 479
480 481 482 483 484 485 486 487   489
490 491 492 493 494 495 496   498 499
500 501 502 503 504   506 507 508 509
510 511 512 513 514 515 516 517 518  
  521 522 523 524 525 526 527 528 529
  531 532 533 534 535 536 537 538 539
540 541 542 543 544 545 546 547 548  
  551 552 553 554 555 556 557 558 559
560 561 562   564 565 566 567 568 569
570 571 572 573 574 575 576 577 578 579
580 581 582 583 584 585 586 587 588 589
590 591 592 593 594 595 596 597 598 599
600 601 602 603   605 606 607 608 609
610 611           617 618 619
620 621 622 623 624 625 626 627 628  
630 631 632 633 634 635 636 637 638 639
640 641 642 643 644 645 646 647 648 649
650 651 652 653 654 655 656 657 658 659
660 661 662 663 664 665   667 668 669
670 671 672 673 674 675 676 677 678 679
680 681 682 683 684 685 686   688 689
690 691 692 693 694 695 696 697 698 699
700 701 702 703 704 705 706 707 708 709
710 711 712 713 714 715 716 717 718 719
720 721 722 723 724 725 726 727 728 729
730 731 732 733 734 735 736 737 738 739
740 741 742 743 744 745  


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: file-name.

Explanation

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

103

ERROR: Invalid file name.

Explanation

The filename in an #include directive must be enclosed in double quotes ("") or angle brackets (<>). See the information on header files in Chapter 4, "Standard Libraries," of the SAS/C C++ Development System User's Guide for information on when to use quotes or 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

WARNING: Redefinition of preprocessor symbol: symbol.
ERROR: 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 line-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

WARNING: Unterminated string or character constant.
ERROR: 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 file-name 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): file-name.

Explanation

The C++ translator expects two filename options (options without a leading dash) - 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 'file-name'.

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 'file-name'.

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 file-name 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 file-name fileid: file-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

WARNING: Syntax error explanation.
ERROR: Syntax error 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.


201

WARNING: Syntax error in #pragma directive: explanation

Explanation

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.

202

WARNING: Invalid #pragma linkage directive. Use an extern [OS] linkage specifier for C++.

Explanation

A #pragma linkage construct was found for OS linkage. The #pragma linkage construct is valid only for C code. In C++, the identifier should be declared with an extern "OS" linkage specifier or with the _ _ibmos keyword. The #pragma may not have the intended effect in all circumstances.

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-value.

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-value' not declared.

Explanation

The specified identifier identifier-value is not declared. It may be misspelled.

320

ERROR: No such class: 'identifier-value'.

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-value'.

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-value'.

Explanation

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

323

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

Explanation

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

324

ERROR: 'identifier-value' 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-1) from (type-2).

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-1' 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-value' 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-value' 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

An object of a class without a default constructor must be defined with explicit initialization.

384

ERROR: Cannot initialize new array.

Explanation

An array created by means of the new operator cannot be initialized by specifying an expression list.

385

WARNING: Delete applied to an object of an undefined class.

Explanation

The delete operator was applied to an object whose class has not been defined. If the class has a member delete operator or a nontrivial destructor, then the object or array will not be properly deallocated.


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. (See the C++ Standard, Section 10.4.)

391

ERROR: Uninitialized const object.

Explanation

In many cases a const object or subobject must have an explicit initialization. Default initialization can be used when the const object is a class or class array for a class with a user-defined default constructor. See the C++ Standard, Section 8.5, paragraph 9.

392

ERROR: Uninitialized reference: reference.

Explanation

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 or reference member must generally 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 generated in some cases where a member contains a const subobject. See the C++ Standard, Section 12.6.2, paragraph 4.

This 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-value' 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. See the C++ Standard, Section 11.2.


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. See the C++ Standard, Section 11.2.

402

ERROR: Cannot access protected member 'member-name' named in class 'class-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. See the C++ Standard, Section 11.


403

ERROR: Cannot access private member 'member-name' named in class 'class-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. See the C++ Standard, Section 11.

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 or non-arithmetic 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 diagnosed with the strict option.

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' must have operands of user defined type.

Explanation

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

434

ERROR: Invalid linkage specifier.

Explanation

The extern keyword must be followed by a string literal specifying "C", "C++", or "OS". This error may also be caused by an extra or misspelled token after an extern keyword. "C", "C++", and "OS" 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", "C++", and "OS" 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. See the C++ Standard, Section 10.1.

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-value'.

Explanation

Enumerations must be defined before they can be used.

443

ERROR: Enum constants 'identifier-value' 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: Invalid member initializer.

Explanation

The initializer for a data member in a class definition must be an integral constant expression. In addition, the member must be a const static member with an integral type. Other static data members must be initialized outside the class. Non-static data members must be initialized in the mem-initializer of each constructor function.

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

WARNING: Invalid access adjustment: 'member-name'.

Explanation

With older compilers, access to a base class member cannot be adjusted in a derived class that defines a member of the same name. Use a using declaration instead of an access declaration to avoid this warning. This message is diagnosed with the strict option.

455

WARNING: Access cannot be changed, but only reinstated.

Explanation

With older compilers, access declarations must declare the inherited member to have the same access as the member in the class from which it is inherited. Use a using declaration instead of an access declaration to avoid this warning. This message is diagnosed with the strict option.

456

WARNING: Previously declared as a member in this class.

Explanation

With older compilers, an access declaration cannot specify a name defined in the derived class. Use a using declaration instead of an access declaration to avoid this warning. This message is diagnosed with the strict option.

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-name' 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-name' 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). Destructors may not be templates. The name of the destructor must be a tilde (~) followed by the class name.

462

ERROR: Operator function 'function-name' has an incorrect number of arguments.

Explanation

An incorrectly declared operator function has been found. Perhaps you have 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-name' 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-name'.

Explanation

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

472

ERROR: Formal 'argument-name' 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-value' 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. However, a void expression is allowed for a return statement in a 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-name' 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 a constant expression.

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.
ERROR: Cannot jump into a block to a label after a declaration having an initializer.

Explanation

It is prohibited to jump into a block (via a GOTO statement) if the destination label occurs after a declaration in the same block that has an initializer. 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

WARNING: 'keyword' cannot be applied to object-type.
ERROR: '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-name' must be the same as their class names 'class-name'.

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 the following 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

WARNING:'operator' is invalid for operand type 'operand'.
ERROR:'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.

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: file-name.

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 or in a named namespace must be declared as static.

557

ERROR: Anonymous unions may only have nonstatic data members.

Explanation

You cannot define an anonymous union that contains nondata members, such as functions or types. If you want such 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-value' 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-value' 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-value 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 (for example, "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 namespace scopes.

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, WARNING: object may not have the same name as its class.

Explanation

A data member, enumeration, member of an anonymous union, or a nested type cannot have the same name as its class. This is a warning for nonstatic data members for compatibility with older code. See the C++ Standard, Section 9.2, paragraph 13.

573

ERROR: Overloaded operator 'operator' cannot have default arguments.

Explanation

Except for operator() and the new and delete operators, it is illegal to declare overloaded operators with default arguments. For example, int operator +(int=3,int=4) is not a valid declaration. See the C++ Standard, Section 13.5.

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 a 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. See the C++ Standard, Section 9.5.

576

ERROR: Error declaring 'new': explanation.

Explanation

The new function must have a return type of void*. Its first argument is required and must be of type size_t.

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}). See the C++ Standard, Section 8.5.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 number 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. Within a function try block for a function with a return value, a return statement is missing at the end of the main body or in one of the handlers for the function try block.

594

WARNING: Zero-length array declared.

Explanation

Zero-length arrays are allowed in classes (classes, structs, and unions)as an extension of standard C and C++. This message is diagnosed with the strict option.

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

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.

597

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.

598

WARNING: sign-type-1 data-type-1 assigned to sign-type-2 data-type-2.
ERROR: 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.

605

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

Explanation

An overloaded operator must be a function.

The ellipsis ('...') may not be used in an overloaded operator except operator new, operator new[], operator delete, operator delete[], and operator().

operator new and operator new[] must be functions returning a void pointer. The first argument must be a size_t.

operator delete and operator delete[] must be functions returning void. The first argument must be a void pointer.


606

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

Explanation

See the explanation for message 605 for restrictions on the types of user-defined operators.

607

ERROR: name must return a type-1 not a type-2.

Explanation

See the explanation for message 605 for restrictions on the types of user-defined operators.

608

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

Explanation

See the explanation for message 605 for restrictions on the types of user-defined operators.

609

ERROR: 'operator delete's first argument must be a 'size_t'.
ERROR: 'operator delete[]'s first argument must be a 'size_t'.

Explanation

See the explanation for message 605 for restrictions on the types of user-defined operators.

610

ERROR: Previous declaration of name was attribute-1, this declaration is attribute-2.

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-name.

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 a function declaration cannot be used before the enclosing classes are complete. Also, the evaluation of a default argument cannot depend recursively on its value.

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-name'.

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. This message is diagnosed with the strict option.

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. Also, scoped friend declarations may not be definitions.

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. Also field types may not be long long or unsigned long long.

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 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-name'.

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 (>max-levels 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 (for example, 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: Explicit template arguments may not be specified here.

Explanation

A template ID (like f <int>) was used in a declaration where it is not valid. Explicit template argument lists may be used for explicit specialization and instantiation declarations, as well as friend function declarations.

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 be type-constraint

Explanation

Template formal parameters cannot be floating point, be void, 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 or 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-name'.

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 'type-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 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

ERROR: Missing return type specifier.

Explanation

The 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 obsolete.

671

NOTE: Suggested explicit template instantiation declaration: information

Explanation

A use was encountered for a template specialization that was not subject to implicit instantiation and not explicitly instantiated. The template instantiation declaration follows. This message is enabled by the showinst option.

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-1 ) from ( type-2 ).

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-1 ) from ( qualifier-2 ).

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-name.

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 or unnamed namespace object 'object-name'

Explanation

During implicit template instantiation, a use of an object or function declared either static or with a signature referring to an unnamed namespace was detected. If the template is defined in multiple translation units, 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 or unnamed namespace use forces automatic template instantiation in primary module.

Explanation

This message is output when static or unnamed namespace use (diagnosed by message 683) forces an automatically instantiated template specialization to be inserted in the primary output module for the current compilation unit. This is because the entity used may not be accessed from other translation units.

685

WARNING: Inline function 'function-name' uses static or unnamed namespace object 'object-name'

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 an object or function that is static or whose signature refers to an unnamed namespace. 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-name was used but not defined.

Explanation

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

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 can be used only as the left operand of a call expression. Examples include the result of expressions with the following operators:

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.

692

ERROR: Operator function 'function-name' may not be a static member.

Explanation

Except for operator new, operator new[], operator delete, and operator delete[], member operator functions must be non-static.

693

ERROR: Operator function 'function-name' must be a class member.

Explanation

Operator functions for operator=, operator->, operator[], and operator() may only be declared as class members.

694

ERROR: Multiple declarations of a default template argument.

Explanation

The default argument for a template parameter may be given in only one template declaration.

695

ERROR: Missing default argument for a template parameter.

Explanation

If a template parameter has a default argument, then all the parameters following it must also have default arguments.

696

ERROR: Default template arguments allowed only for class templates.

Explanation

Default template arguments are allowed only on the declaration or definition of a class template, not on function templates or template member definitions.

697

ERROR: Default template argument does not match formal.

Explanation

A default template argument does not match the type of its corresponding template formal.

698

WARNING: Obsolete specification of array length in a 'delete[]' expression.

Explanation

An expression was specified inside the square brackets of a delete[] expression. This is an obsolete C++ feature and will not be supported in the future. The expression is ignored.

This warning can be resolved by removing the expression inside the square brackets.


699

ERROR: Function 'function-name' in unnamed namespace used but not defined.

Explanation

The specified function was declared in an unnamed namespace and used, but never defined, in this source file.

700

ERROR: Object 'object-name' was used and requires a definition in this translation unit.

Explanation

The specified object was declared in a scope with a signature that is inside an unnamed namespace or references (via template or function arguments) an entity from an unnamed namespace. Such objects cannot be defined in other translation units.

701

ERROR: Scoped declaration must occur in scope-type.

Explanation

Scoped declaration must occur in an enclosing namespace scope or in the scope of the containing class declaration.

Except for friend declarations, explicit specializations, and explicit instantiations, a declaration with a qualified ID declarator for a namespace scoped variable, function, function template, class member, or class template member must be a definition in an enclosing namespace scope of the original declaration of the item or template.

Except for friend declarations, explicit specializations, and explicit instantiations, a definition of a nonlocal class using a qualified ID in the class header must be in an enclosing namespace scope of the original declaration of the class.

A definition of a local, nested class using a qualified ID in the class header must be in the same block scope as the definition of the containing class.


702

WARNING: Qualified declarator names an enclosing namespace 'name'

Explanation

No part of the nested name specifier in the qualifier of the declarator ID for a definition of a namespace or class member outside its class or namespace may refer to any enclosing namespaces. See the C++ Standard, Section 8.3, paragraph 1.

703

ERROR: Explicit specialization may not be declared here.

Explanation

An explicit specialization must first be declared in the namespace scope of which the template is declared or, for template members, in the namespace scope in which the containing template was declared. The specialization may be defined in an enclosing namespace if it is first explicitly specialized in the original namespace.

704

ERROR: Explicit instantiation may not be declared here.

Explanation

An explicit instantiation for a class or function template specialization must be in the namespace scope where the template was defined. An explicit instantiation of a member of a class template must be in the namespace scope where the class template was defined. An explicit instantiation for a member template must be in the namespace scope where the containing class or class template was defined.

705

ERROR: 'declaration-name' not previously declared.

Explanation

A declaration with a scoped declarator was found. Such a declaration must refer to a previous declaration, but no such declaration was found.

706

ERROR: Must be a definition.

Explanation

A scoped declaration was found for an item that must be defined, not just redeclared.

707

ERROR: Cannot bind reference to a bitfield lvalue.

Explanation

A bitfield is not addressable; therefore, there is no way to bind a reference to it. Using a const reference allows a temporary to be introduced to hold the bitfield value.

708

ERROR: Copy assignment for the class 'class-name' cannot be implicitly defined.

Explanation

A use of the implicitly declared copy assignment operator for a class was found that required definition of the operator. But the class has const or reference non-static data members, which makes it impossible to implicitly define the operator.

709

ERROR: Not a namespace name.

Explanation

The name specified in a using directive did not resolve to a namespace.

710

ERROR: A using declaration may not specify a template id.

711

ERROR: A using declaration must specify a qualified id.

712

ERROR: Must be a namespace member.

Explanation

using declarations in function and namespace scopes must specify a namespace member name.

713

ERROR: Must be a base class member.

Explanation

using declarations in class scopes must specify a base class member name.

714

ERROR: Overloaded using declaration.

Explanation

A using declaration for a function has been overloaded by a regular declaration with the same name and parameter types. This is not allowed except in class scopes.

715

ERROR: 'member-1' was previously declared with 'member-2' access.

Explanation

The member was previously declared with a different access specifier.

716

ERROR: 'object-name' was previously declared as a different object.

Explanation

The name specified was previously declared to refer to a different object. This can happen when either the current declaration or the previous one was a using declaration. One of the declarations must be removed or renamed.

717

ERROR: 'member-name' was declared by a using declaration.

Explanation

The member specified was originally declared in its scope by a using declaration. Such a member may not be specified in a qualified declarator. Declare it instead with the original scope of the object or function to which the using declaration refers.

718

ERROR: 'function-name' is not a function template name.

Explanation

An explicit specialization, explicit instantiation, or a declaration with an explicit template argument list in the declarator was used for a name that was not a template function name.

719

ERROR: Member must be visible in a direct base class.

Explanation

The object, type name, or function referred to in a using declaration or access declaration for a class member must be visible in a direct base class of the class containing the using declaration.

720

ERROR, WARNING: Using declaration refers to an ambiguous base class member 'member-name'.

Explanation

A using declaration refers to a member of a base class that is an ambiguous base of the class containing the using declaration. A reference to the member via the using declaration will be ambiguous.

721

ERROR: Member templates may not be virtual.

Explanation

A class member template function was declared with the virtual keyword.

722

ERROR: Invalid pure specifier.

Explanation

The initializer used to declare a function as pure must be the literal number 0.

723

ERROR: The 'template' keyword was used with a non-template name 'template-name'.

Explanation

A nested name specifier, followed by the template keyword and a name was encountered; however, when resolved, the name was not a template.

724

ERROR: Found unexpected type name 'type-name'. Use the 'typename' keyword.

Explanation

In template expressions, the typename keyword is required to identify template formal dependent names that refer to types.

725

ERROR: The 'typename' keyword was applied to an unqualified id 'type-name'.

Explanation

Except when declaring a template formal, a name following the typename keyword must have a scope qualifier.

726

ERROR: 'template-name' is not a class template name.

Explanation

The default argument for a template parameter must be a class template name. Note that within the scope of a specialization of a template, the unqualified name of the template is treated as a reference to the specialized class, not the template.

727

ERROR: A friend declaration may not define a class

Explanation

This can be resolved by defining the class separately from the friend declarations. For example:
   class C {
      class N;
      friend class N;  // N was forward declared to refer to C::N
      class N { ... };
      ...
   };

728

WARNING: Possible misuse of Boolean with composite operator.

Explanation

An arithmetic assignment operator (like +=) is being used to update a target lvalue with bool type. The result is computed by converting to the common arithmetic type, performing the arithmetic operation, and then converting back to bool. This may not produce the expected result.

729

ERROR: Cannot throw void or an undefined class or class pointer.

Explanation

The argument to a throw expression may not be a class value or a class pointer value for a class that has not been previously defined, nor can the argument have a void type.

730

ERROR: The catch(...) handler must be the final handler.

Explanation

No catch handlers may follow a catch handler specified with "..." as the handler type. Handlers are considered in the order specified in the handler list. Since a "..." handler matches any exception object, any following handlers would never be matched. Move the "..." handler to the end of the list.

731

ERROR: Cannot jump into try block or handler.

Explanation

Jumps (via goto or switch) into the middle of the initial subblock of a try block or into a catch handler subblock from outside the subblock are not allowed. These subblocks have exception handling tasks that are incompatible with such transfers of control.

732

ERROR: Exception specification for 'function-name' does not match previous declaration.

Explanation

When a function is redeclared, the exception specification must match the previous declaration. Similarly, redeclarations of pointers, references, and member pointers to functions must have matching exceptions specifications. Note that only explicit instantiations may omit the exception specifications when declaring functions.

733

ERROR: Exception specification type may not be void or an undefined class, class reference, or class pointer.

Explanation

The type specified must be valid for an exception object type.

734

ERROR: Exception specifications may only appear in a non-typedef declaration or definition.

Explanation

In particular, exception specifications may only appear in object, reference, or function declarations in block, global, or class scope. Exception specifications may not appear in typedef declarations, function formal declarations, catch declarations, return types, template formals, template actuals, cast type specifiers, or other type names.

735

ERROR: Exception specification for overriding virtual function 'function-name' includes types not allowed by the overridden function 'function-name'.

Explanation

The exception specification for an overridden virtual function must allow all types in the exception specification for the overriding specification. For example:
   struct B {...};
   struct D : public B {...};
   struct S {
      virtual void e();  // propagates all exceptions
      virtual void f() throw(); // propagates no exceptions
      virtual void g() throw( int );  // propagates int exceptions
      virtual void h() throw( int );  // propagates int exceptions
      virtual void x() throw( B );  // propagates B exceptions
   };
   struct T : public S {
      void e();  // OK, all exceptions allowed by S::e()
      void f() throw(int);  // error, int not allowed by S::f
      void g() throw();  // OK, no exceptions propagated
      void h();  // error, S::h() only allows int
      void x() throw( D );  // OK, S::h() allows public base B
   };
 

A type is allowed in the exception specification of an overriding function if the same type is in the exception specification for the overridden function. Also, a class type is allowed in the exception specification of an overriding function if an unambiguous public base of the class is in the exception specification for the overridden function. Similarly, a class pointer type is allowed in the exception specification of an overriding function if a pointer to an unambiguous public base of the class is in the exception specification for the overriden function.


736

ERROR: Exception specification mismatch for assignment or initialization.

Explanation

In an assignment or initialization, the exception specifications for the target did not match the exception specifications for the source. When initializing a function reference, function pointer, or function member pointer, or when assigning to a function pointer or function member pointer, the exception specification for the target function type must allow all exceptions in the exception specification for the source function type. See message 735 for the rules controlling what types are allowed in the source type. In all other cases, exception specifications must match exactly.

737

ERROR: Empty list initializer used for array with missing size.

Explanation

An initialized declaration like int a[] = {}; was encountered. Normally, a missing array size can be determined by using the number of elements in the initializer list. However, arrays of size zero are not generally allowed.

738

WARNING: Missing or ambiguous placement delete operator 'operator-name'.

Explanation

A new expression with placement arguments was encountered and there were either zero or multiple corresponding placement delete operators found for handling cleanup in cases where the new object initialization throws an exception. This message indicates a potential memory leak. Note that the operator delete name is looked up by the same method used for delete expressions, so the name may be found in a different scope than the operator new name. This message is diagnosed with the strict option.

739

ERROR: Illegal return statement in function try block handler for a constructor.

Explanation

A return statement is not allowed in a handler of a function try block for a constructor function. The constructor is not allowed to return normally because the object is in an unconstructed state. The handler may exit the program, rethrow the current exception, or throw a new exception.

740

WARNING | ERROR: Constant value out of range.

Explanation

The specified integral constant expression had a value that could not be represented in the context in which it was used. An error is generated when array sizes in declarations and enumeration value initializers have values outside the range of a long or unsigned long. A warning is generated when initializing or assigning a integral constant to an arithmetic type that cannot represent the constant value. The warnings can be eliminated by correcting the constant value or using an explicit cast.

741

ERROR: Exception handling not enabled.

Explanation

A try block, throw expression, or throw specification was found but, the except option was not specified. Turn on the except option to support exception handling.

742

ERROR: Previously initialized in the class body.

Explanation

When a static const data member of a class is declared with a value in the class body, the definition of the member may not have an initializer. This error can be corrected by removing the initializer for the definition. For example:
   struct S {
      static const int one = 1;
      static const int two = 2;
   };
   const int S::one = 1;  // error
   const int S::two;      // OK, initialized to 2

743

WARNING: Multiple assignments to the same lvalue between sequence points.

Explanation

If a scalar object is modified more than once between sequence points, the final value is undefined. Rewrite the code to add a sequence point between the modifications.

This is currently only detected when the result of an assignment, prefix increment, or prefix decrement operator is used as the lvalue operand of an assignment, increment, or decrement operator.


744

'identifier-value' previously declared as external to be a type-name.

Explanation

The specified identifier was previously declared with another type in a namespace scope or as an extern in a function block.

745

WARNING: Type of external function-ID uses an unnamed or local class or enum.
Type of external function-ID uses...
ERROR: Type of external function-ID uses an unnamed or local class or enum.
Type of external function-ID uses...

Explanation

The specified function or object has linkage, but its type refers to an unnamed class or enum or a class or enum declared locally inside a function. The function or object cannot be referred to from other compilation units because the type is not available. If the type is correct and the item is not a class member, the item can be declared with internal linkage using the static keyword. For class members, if the class has external linkage, the types being used for member declarations must have names.

This is currently an error only when local types are used.


Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.