HP aC++/HP C A.06.25 Programmer's Guide

“Duplicate Formal Argument Names” (page 283)
Ambiguous Function or Object Declaration” (page 283)
“Overloaded Operations ++ and --” (page 284)
“Reference Initialization” (page 284)
“Using operator new to Allocate Arrays” (page 285)
“Parentheses in Static Member Initialization List” (page 285)
“&qualified-id Required in Static Member Initialization List” (page 286)
“Non-constant Reference Initialization” (page 286)
“Digraph White Space Separators” (page 287)
Explicit int Declaration
In HP C++, you do not need to explicitly specify int types. In HP aC++, you must
explicitly declare int types. This change reduces ambiguity among expressions
involving function-like casts and declarations.
Example:
The following code is valid in HP C++:
void f(const parm);
const n = 3;
main()
The equivalent, valid HP aC++ code follows:
void f(const int parm);
const int n = 3;
int main()
The for Statement, New Scoping Rules
In HP C++, variables declared in the initializer list are allowed after the for statement.
In the ANSI/ISO C++ International Standard, variables declared in the initializer list
are not allowed after the for statement. HP aC++ provides this functionality when you
specify the following aCC command-line option:
-WC,-ansi_for_scope,on
If you do not specify this option, (or you specify the -WC,-ansi_for_scope,off
option), by default, the new rules do not take effect.
In this scenario, HP aC++ provides this standard functionality as an option to ease
conversion of existing code to the standard. No code change is currently required.
Future plans are to make the ANSI/ISO C++ International Standard syntax the default.
HP recommends that you correct your code, by moving the declaration of the for loop
variable to its enclosing block.
Example:
278 Migrating from HP C++ (cfront) to HP aC++