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

Example:
void f(int &);
int main () {
f(3);
return 0;
}
Compiling this code with HP C++ generates the following warning:
CC: DDB04313A.C, line 4: warning: temporary used for non-const int & argument;
no changes will be propagated to actual argument (anachronism) (283)
Compiling the above code with HP aC++ generates the following error:
Future Error: File DDB04313A.C, Line 4
The initializer for a non-constant reference must be an lvalue.
Try changing int & to const int &.
To successfully compile the code with either compiler, use one of the two alternatives
shown below:
void f(const int &); // Use a constant reference.
int main () {
f(3);
return 0;
}
Or
void f(int &);
int i;
int main () {
i=3;
f(i); // Use an lvalue for reference initialization.
return 0;
}
Digraph White Space Separators
HP C++ does not support alternative tokens (digraphs). In HP aC++, digraphs are
supported and legal C++ syntax can be considered an error because of digraph
substitution. Insert a blank between two characters of the digraph.
Example:
C<::A> a;
The characters <: are one of the alternative tokens (digraphs) for which HP aC++
performs a substitution. In this case, <: becomes [. The statement to be compiled
becomes C[:A a;, which produces many compilation errors.
To successfully compile this program with either compiler, insert a blank between <
and :.
Example:
C< ::A> a;
Migration Considerations Related to Standardization 287