HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
Changes in C++ Syntax
When you migrate from HP C++ to HP aC++, in addition to changes related to standards
based keywords, you may need to make changes to your source code in the following
areas:
• “Explicit int Declaration” (page 264)
• “The for Statement, New Scoping Rules” (page 265)
• “struct as Template Type Parameter is Permitted” (page 265)
• “Base Template Class Reference Syntax Change” (page 266)
• “Tokens after #endif” (page 266)
• “overload not a Keyword” (page 267)
• “Dangling Comma in enum” (page 267)
• “Static Member Definition Required” (page 267)
• “Declaring friend Classes” (page 268)
• “Incorrect Syntax for Calls to operator new” (page 268)
• “Using :: in Class Definitions” (page 269)
• “Duplicate Formal Argument Names” (page 269)
• “Ambiguous Function or Object Declaration” (page 269)
• “Overloaded Operations ++ and --” (page 270)
• “Reference Initialization” (page 271)
• “Using operator new to Allocate Arrays” (page 271)
• “Parentheses in Static Member Initialization List” (page 272)
• “&qualified-id Required in Static Member Initialization List” (page 272)
• “Non-constant Reference Initialization” (page 273)
• “Digraph White Space Separators” (page 274)
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()
264 Migrating from HP C++ (cfront) to HP aC++