HP aC++/HP ANSI C Release Notes (B3901-90037; A.06.26; September 2011)
Example 1 Expression in default compilation mode
({ int y = foo (); int z; if (y > 0) z = y; else z = - y; z; })
This is a valid expression for the absolute value of foo (). The last item in the compound
statement should be an expression followed by a semicolon (;). The value of this
sub-expression serves as the value of the entire construct.
Support for _Pragma ("once")
The _Pragma ("once") operator is equivalent to #pragma once. This operator
ensures that the source file is included only once during compilation.
C++0x language extensions
This release provides two new features related to C++0x language extensions.
Unnamed types and static routines are given globally unique names
The unnamed classes and enums in namespaces (including the global namespace) as
well as static functions are now mangled such that they do not collide with names from
other translation units and can be used in the mangled names of template functions.
Example 2 Globally unique names for unnamed types and static routines
template void f(T) {} template void f(T, T1) {} struct {} s; enum {} e; static void f2(); void f1()
{ f2();
// ZN22_INTERNAL_3_x_c__Z2f1v2f2Ev f(s);
// _Z1fIN22_INTERNAL_3_x_c__Z2f1v4__C1EEvT f(e);
// IA-64: Z1fIN22_INTERNAL_3_x_c__Z2f1v4__E2EEvT f(s, s);
//_Z1fIN22_INTERNAL_3_x_c__Z2f1v4__C1ES1_EvT_T0_ f(e, e);
// Z1fIN22_INTERNAL_3_x_c__Z2f1v4__E2ES1_EvT_T0 f(s, e);
//_Z1fIN22_INTERNAL_3_x_c__Z2f1v4__C1ENS0_4__E2EEvT_T0_ }
static void f2() { struct A {} a; f(a);
//_Z1fIZN22_INTERNAL_3_x_c__Z2f1v2f2EvE1AEvT_ }
Rvalue references
This feature is enabled with the -Ax option, which turns on support for selected features
from the upcoming C++ standard (called C++0x).
The existence of Rvalue references allows the declaration of move constructors, which
can be used to efficiently copy class objects by transferring the resources from a source
object, that is soon to be defunct, to a destination object.
Option to redirect make-dependency
The options +make and +Make generate the make-dependency list, and writes this out
to the stdout. This list can be captured into a .d file that is based on the basename
of the object file.
The new option +Makef writes out the make-dependency to a file that you specify
(including the file name and location). This facility is on the lines of the GNU options -M
and -MF.
C++0x language extensions 9