Abstract for XL C/C++ Language Reference
Scope and linkage
Scope
Block/local scope
Function scope
Function prototype scope
File/global scope
Examples of scope in C
Class scope (C++ only)
Namespaces of identifiers
Name hiding (C++ only)
Program linkage
Internal linkage
External linkage
No linkage
Language linkage (C++ only)
Lexical elements
Tokens
Keywords
Identifiers
Literals
Integer literals
Boolean literals
Floating-point literals
Fixed-point decimal literals
Character literals
String literals
Pointer literal (C++11)
Punctuators and operators
Source program character set
Multibyte characters
Escape sequences
The Unicode standard
Digraph characters
Trigraph sequences
Comments
Data objects and declarations
Overview of data objects and declarations
Overview of data objects
Overview of data declarations and definitions
_Static_assert declaration (C11)
static_assert declaration (C++11)
Storage class specifiers
The auto storage class specifier
The static storage class specifier
The extern storage class specifier
The mutable storage class specifier (C++ only)
The register storage class specifier
Type specifiers
Integral types
Boolean types
Floating-point types
Fixed point decimal types (C only)
Character types
The void type
The atomic type (C11)
User-defined types
Structures and unions
Enumerations
Compatibility of structures, unions, and enumerations (C only)
typedef definitions
The auto type specifier (C++11)
The decltype(expression) type specifier (C++11)
The constexpr specifier (C++11)
Compatibility of arithmetic types (C only)
Type qualifiers
The __callback type qualifier
The atomic qualifier (C11)
The const type qualifier
The __far type qualifier (C only)
The __ptr32 type qualifier
The __ptr64 type qualifier (C only)
The restrict type qualifier
The volatile type qualifier
Type attributes (IBM extension)
The amode31 | amode64 type attribute (C only)
The armode | noarmode type attribute (C only)
The may_alias type attribute
Declarators
Overview of declarators
Examples of declarators
Type names
Pointers
Pointer arithmetic
Type-based aliasing
Compatibility of pointers (C only)
Arrays
Variable length arrays
Compatibility of arrays (C only)
References (C++ only)
Initializers
Initialization and storage classes
Designated initializers for aggregate types (C only)
Initialization of structures and unions
Initialization of enumerations
Initialization of pointers
Initialization of arrays
Initialization of references (C++ only)
Initialization of complex types (C11)
Declarator qualifiers
The _Packed qualifier (C only)
The _Export qualifier (C++ only)
Variable attributes (IBM extension)
The aligned variable attribute
Type conversions
Arithmetic conversions and promotions
Integral conversions
Boolean conversions
Floating-point conversions
Packed decimal conversions (C only)
Usual arithmetic conversions
Integral and floating-point promotions
Lvalue-to-rvalue conversions
Pointer conversions
Conversion to void*
Reference conversions (C++ only)
Function argument conversions
Expressions and Operators
Lvalues and rvalues
Primary expressions
Names
Literals
Integer constant expressions
Identifier expressions (C++ only)
Parenthesized expressions ( )
Generic selection (C11)
Scope resolution operator :: (C++ only)
Generalized constant expressions (C++11)
Function call expressions
Member expressions
Dot operator .
Arrow operator ->
Unary expressions
Increment operator ++
Decrement operator --
Unary plus operator +
Unary minus operator -
Logical negation operator !
Bitwise negation operator ~
Address operator &
Indirection operator *
The typeid operator (C++ only)
The __alignof__ operator (IBM extension)
The sizeof operator
The typeof operator (IBM extension)
The digitsof and precisionof operators (C only)
The __real__ and __imag__ operators (IBM extension)
Binary expressions
Assignment operators
Multiplication operator *
Division operator ⁄
Remainder operator %
Addition operator +
Subtraction operator -
Bitwise left and right shift operators << >>
Relational operators < > <= >=
Equality and inequality operators == !=
Bitwise AND operator &
Bitwise exclusive OR operator ‸
Bitwise inclusive OR operator |
Logical AND operator &&
Logical OR operator ||
Array subscripting operator [ ]
Comma operator ,
Pointer to member operators .* ->* (C++ only)
Conditional expressions
Types in conditional C expressions (C only)
Types in conditional C++ expressions (C++ only)
Examples of conditional expressions
Cast expressions
Cast operator ()
The static_cast operator (C++ only)
The reinterpret_cast operator (C++ only)
The const_cast operator (C++ only)
The dynamic_cast operator (C++ only)
Compound literal expressions
new expressions (C++ only)
Placement syntax
Initialization of objects created with the new operator
Handling new allocation failure
delete expressions (C++ only)
throw expressions (C++ only)
Operator precedence and associativity
Reference collapsing (C++11)
Statements
Labeled statements
Labels as values (IBM extension)
Expression statements
Resolution of ambiguous statements (C++ only)
Block statements
Example of blocks
Selection statements
The if statement
The switch statement
Iteration statements
The while statement
The do statement
The for statement
Jump statements
The break statement
The continue statement
The return statement
The goto statement
Null statement
Inline assembly statements (IBM extension)
Restrictions on inline assembly statements
Functions
Function declarations and definitions
Function declarations
Function definitions
Explicitly defaulted functions (C++11)
Deleted functions (C++11)
Examples of function declarations
Examples of function definitions
Compatible functions (C only)
Multiple function declarations (C++ only)
Function storage class specifiers
The static storage class specifier
The extern storage class specifier
Function specifiers
The inline function specifier
The _Noreturn function specifier
The __cdecl function specifier (C++ only)
The _Export function specifier (C++ only)
Function return type specifiers
Function return values
Function declarators
Parameter declarations
Trailing return type (C++11)
Function attributes (IBM extension)
always_inline
amode31 | amode64
armode | noarmode
gnu_inline
malloc
used
The main() function
Command-line arguments
Function calls
Pass by value
Pass by pointer
Pass by reference (C++ only)
Allocation and deallocation functions (C++ only)
Default arguments in C++ functions (C++ only)
Restrictions on default arguments (C++ only)
Evaluation of default arguments (C++ only)
Pointers to functions
Atomic library (C11)
Macros (C11)
Types (C11)
Atomic integer types (C11)
Atomic library functions (C11)
atomic_init (C11)
atomic_thread_fence (C11)
atomic_signal_fence (C11)
atomic_is_lock_free (C11)
atomic_store (C11)
atomic_store_explicit (C11)
atomic_load (C11)
atomic_load_explicit (C11)
atomic_exchange (C11)
atomic_exchange_explicit (C11)
atomic_compare_exchange_strong (C11)
atomic_compare_exchange_strong_explicit (C11)
atomic_compare_exchange_weak (C11)
atomic_compare_exchange_weak_explicit (C11)
atomic_fetch_add (C11)
atomic_fetch_add_explicit (C11)
atomic_fetch_sub (C11)
atomic_fetch_sub_explicit (C11)
atomic_fetch_or (C11)
atomic_fetch_or_explicit (C11)
atomic_fetch_xor (C11)
atomic_fetch_xor_explicit (C11)
atomic_fetch_and (C11)
atomic_fetch_and_explicit (C11)
atomic_flag_test_and_set (C11)
atomic_flag_test_and_set_explicit (C11)
atomic_flag_clear (C11)
atomic_flag_clear_explicit (C11)
Atomic library (C++11)
The memory_order type (C++11)
Lock-free property (C++11)
The atomic types (C++11)
Synopsis
Member functions (C++11)
Constructors (C++11)
atomic::atomic (C++11)
atomic::operator= (C++11)
atomic::is_lock_free (C++11)
atomic::store (C++11)
atomic::load (C++11)
atomic::operator C (C++11)
atomic::exchange (C++11)
atomic::compare_exchange_weak (C++11)
atomic::compare_exchange_strong (C++11)
Specialized member functions (C++11)
atomic::fetch_add (C++11)
atomic::fetch_sub (C++11)
atomic::fetch_and (C++11)
atomic::fetch_or (C++11)
atomic::fetch_xor (C++11)
atomic::operator++ (C++11)
atomic::operator++(int) (C++11)
atomic::operator-- (C++11)
atomic::operator--(int) (C++11)
atomic::operator+= (C++11)
atomic::operator-= (C++11)
atomic::operator&= (C++11)
atomic::operator| = (C++11)
atomic::operator^ = (C++11)
Operations on atomic types (C++11)
atomic_is_lock_free (C++11)
atomic_store (C++11)
atomic_store_explicit (C++11)
atomic_load (C++11)
atomic_load_explicit (C++11)
atomic_exchange (C++11)
atomic_exchange_explicit (C++11)
atomic_compare_exchange_weak (C++11)
atomic_compare_exchange_weak_explicit (C++11)
atomic_compare_exchange_strong (C++11)
atomic_compare_exchange_strong_explicit (C++11)
atomic_fetch_add (C++11)
atomic_fetch_add_explicit (C++11)
atomic_fetch_sub (C++11)
atomic_fetch_sub_explicit (C++11)
atomic_fetch_and (C++11)
atomic_fetch_and_explicit (C++11)
atomic_fetch_or (C++11)
atomic_fetch_or_explicit (C++11)
atomic_fetch_xor (C++11)
atomic_fetch_xor_explicit (C++11)
Flag type and operations (C++11)
The atomic_flag type (C++11)
Constructor (C++11)
atomic_flag::atomic_flag (C++11)
atomic_flag::clear (C++11)
atomic_flag::test_and_set (C++11)
atomic_flag_test_and_set (C++11)
atomic_flag_test_and_set_explicit (C++11)
atomic_flag_clear (C++11)
atomic_flag_clear_explicit (C++11)
Initialization (C++11)
atomic_init (C++11)
ATOMIC_VAR_INIT (C++11)
ATOMIC_FLAG_INIT (C++11)
Memory synchronization order (C++11)
kill_dependency (C++11)
atomic_thread_fence (C++11)
atomic_signal_fence (C++11)
Constexpr functions (C++11)
Namespaces (C++ only)
Defining namespaces
Declaring namespaces
Creating a namespace alias
Creating an alias for a nested namespace
Extending namespaces
Namespaces and overloading
Unnamed namespaces
Namespace member definitions
Namespaces and friends
The using directive
The using declaration and namespaces
Explicit access
Inline namespace definitions (C++11)
Overloading (C++ only)
Overloading functions
Restrictions on overloaded functions
Overloading operators
Overloading unary operators
Overloading increment and decrement operators
Overloading binary operators
Overloading assignments
Overloading function calls
Overloading subscripting
Overloading class member access
Overload resolution
Implicit conversion sequences
Resolving addresses of overloaded functions
Classes (C++ only)
Declaring class types
Using class objects
Classes and structures
Scope of class names
Incomplete class declarations
Nested classes
Local classes
Local type names
Class members and friends (C++ only)
Class member lists
Data members
Member functions
Inline member functions
Constant and volatile member functions
Virtual member functions
Special member functions
Member scope
Pointers to members
The this pointer
Static members
Using the class access operators with static members
Static data members
Static member functions
Member access
Friends
Friend scope
Friend access
Inheritance (C++ only)
Derivation
Inherited member access
Protected members
Access control of base class members
The using declaration and class members
Overloading member functions from base and derived classes
Changing the access of a class member
Multiple inheritance
Virtual base classes
Multiple access
Ambiguous base classes
Virtual functions
Ambiguous virtual function calls
Virtual function access
Abstract classes
Special member functions (C++ only)
Overview of constructors and destructors
Constructors
Default constructors
Delegating constructors (C++11)
Constexpr constructors (C++11)
Explicit initialization with constructors
Initialization of base classes and members
Constructor execution order of class objects
Destructors
Pseudo-destructors
User-defined conversions
Conversion constructors
Explicit conversion constructors
Conversion functions
Explicit conversion operators (C++11)
Copy constructors
Copy assignment operators
Templates (C++ only)
Template parameters
Type template parameters
Non-type template parameters
Template template parameters
Default arguments for template parameters
Naming template parameters as friends (C++11)
Template arguments
Template type arguments
Template non-type arguments
Template template arguments
Class templates
Class template declarations and definitions
Static data members and templates
Member functions of class templates
Friends and templates
Function templates
Template argument deduction
Overloading function templates
Partial ordering of function templates
Template instantiation
Explicit instantiation
Implicit instantiation
Template specialization
Explicit specialization
Partial specialization
Variadic templates (C++11)
Name binding and dependent names
The typename keyword
The template keyword as qualifier
Exception handling (C++ only)
try blocks
Nested try blocks
catch blocks
Function try block handlers
Arguments of catch blocks
Matching between exceptions thrown and caught
Order of catching
throw expressions
Rethrowing an exception
Stack unwinding
Exception specifications
Special exception handling functions
The unexpected() function
The terminate() function
The set_unexpected() and set_terminate() functions
Example using the exception handling functions
Preprocessor directives
Macro definition directives
The #define directive
The #undef directive
The # operator
The ## operator
Standard predefined macro names
File inclusion directives
The #include directive
The #include_next directive (IBM extension)
Conditional compilation directives
The #if and #elif directives
The #ifdef directive
The #ifndef directive
The #else directive
The #endif directive
Extension of #endif and #else (IBM extension)
Message generation directives
The #error directive
The #line directive
The null directive (#)
Pragma directives
The _Pragma preprocessing operator
Standard pragmas
C99 preprocessor features adopted in C++11 (C++11)
z/OS XL C/C++ pragmas
Pragma directive syntax
Scope of pragma directives
IPA effects
Summary of compiler pragmas by functional category
Language element control
C++ template pragmas
Floating point and integer control
Error checking and debugging
Listings, messages and compiler information
Optimization and tuning
Object code control
Portability and migration
Individual pragma descriptions
#pragma arch_section (IBM extension)
#pragma chars
#pragma checkout
#pragma comment
#pragma convert
#pragma convlit
#pragma csect
#pragma define (C++ only)
#pragma disjoint
#pragma do_not_instantiate (C++ only)
#pragma enum
#pragma environment (C only)
#pragma execution_frequency
#pragma export
#pragma extension
#pragma filetag
#pragma hashome (C++ only)
#pragma implementation (C++ only)
#pragma info (C++ only)
#pragma inline (C only) / noinline
#pragma insert_asm (C only)
#pragma ishome (C++ only)
#pragma isolated_call
#pragma langlvl (C only)
#pragma leaves
#pragma linkage (C only)
#pragma longname/nolongname
#pragma map
#pragma margins/nomargins
#pragma namemangling (C++ only)
#pragma namemanglingrule (C++ only)
#pragma object_model (C++ only)
#pragma operator_new (C++ only)
#pragma option_override
#pragma options (C only)
#pragma pack
#pragma page (C only)
#pragma pagesize (C only)
#pragma priority (C++ only)
#pragma prolog (C only), #pragma epilog (C only)
#pragma reachable
#pragma report (C++ only)
#pragma runopts
#pragma sequence
#pragma skip (C only)
#pragma strings
#pragma subtitle (C only)
#pragma target (C only)
#pragma title (C only)
#pragma unroll
#pragma variable
#pragma wsizeof
#pragma XOPTS
Pragma directives for parallel processing
Compiler predefined macros
General macros
Macros indicating the z/OS XL C/C++ compiler
Macros related to the platform
Macros related to compiler features
Macros related to compiler option settings
Macros related to language levels
The IBM XL C/C++ language extensions
General IBM extensions
Extensions for C11 compatibility
C++11 compatibility
Extensions for GNU C/C++ compatibility
Extensions for Unicode support
Extensions for vector processing support
C and C++ compatibility on the z/OS platform
Common Usage C language level for the z/OS platform
Conforming to POSIX 1003.1
Implementation-defined behavior